2

私はこのサンプルコードを持っています:

<?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ファイルは表示されますが、透かしは表示されません。私は何を間違っていますか?私を助けてください。ありがとう。

4

1 に答える 1

1

に変えるしか$pdf = new FPDF();ない$pdf = new PDF();

于 2013-04-12T03:11:48.807 に答える