Php 使用fpdf的新页面分页符

Php 使用fpdf的新页面分页符,php,pdf,fpdf,Php,Pdf,Fpdf,我想使用fpdf创建第二个页面。下面给出了代码。在指定区域的代码中,我想开始新页面。这里的pdf类是从fpdf扩展而来的 class PDF extends FPDF { function header{ $this->Ln(20); $this->SetFont('Times','',10); $this->Cell(0,10,'Kondotty'); $this->Ln(10); $this->SetFont('Tim

我想使用fpdf创建第二个页面。下面给出了代码。在指定区域的代码中,我想开始新页面。这里的pdf类是从fpdf扩展而来的

class PDF extends FPDF
 {

function header{
$this->Ln(20);
     $this->SetFont('Times','',10);
     $this->Cell(0,10,'Kondotty');
     $this->Ln(10);
     $this->SetFont('Times','',10);
     $this->Cell(80,0,'07/10/2014');


    $this->Cell(60,0,'Seal');
    $this->Cell(0,0,'Head of Institution');


//END FIRST PAGE

// STARTING SECOND PAGE




    $this->Ln(10);

    $this->Cell(27);
     $this->Cell(0,10,'Her conduct and character were found ...................................... during that period.');

     $this->Ln(20);
     $this->SetFont('Times','',10);
     $this->Cell(0,10,'Kondotty');
     $this->Ln(10);
     $this->SetFont('Times','',10);
     $this->Cell(80,0,'07/10/2014');
     }

    }  
例如:

我声明
$I=0
在我的PDF的开头,对于我在foreach中添加的每一行,我都计算
$I
就像
$I++
一样。 例如,如果你想在
x
行之后换页,你可以说:

if($i%30==0 && $i!=0) {
   $this->addPage();
}
以及添加新页面的功能:

private function addPage()
{
   $this->page = $this->pdf->newPage('A4');

我希望这将为您指明正确的方向。

$this->pdf->newPage('A4');在这个pdf->引用什么?我的意思是pdf是一个对象?是的,在我的例子中它是$this->pdf=new\Zend_pdf();