Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php FPDF水印不';不出现_Php_Fpdf - Fatal编程技术网

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()