Php FPDF水印不';不出现
我有以下示例代码:Php FPDF水印不';不出现,php,fpdf,Php,Fpdf,我有以下示例代码: <?php session_start(); define('FPDF_FONTPATH', 'font/'); require('fpdf/rotation.php'); class PDF extends PDF_Rotate { function Header() { //Put the watermark $this->SetFont(
<?php
session_start();
define('FPDF_FONTPATH', 'font/');
require('fpdf/rotation.php');
class PDF extends PDF_Rotate
{
function Header()
{
//Put the watermark
$this->SetFont('Arial','B',50);
$this->SetTextColor(255,192,203);
$this->RotatedText(35,190,'Preview Only!',45);
}
function RotatedText($x, $y, $txt, $angle)
{
//Text rotated around its origin
$this->Rotate($angle,$x,$y);
$this->Text($x,$y,$txt);
$this->Rotate(0);
}
}
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',12);
$pdf->Cell(40,10,'Sample line');
$pdf->Output();
?>
它确实显示PDF文件,但不显示水印。我做错了什么?请帮帮我。谢谢。我只需要更改
$pdf=new FPDF()
至$pdf=new pdf()代码>