AcceptPageBreak

boolean AcceptPageBreak()

版本

1.4

內容

每逢有分页的情况出现,就代表这个功能已经被执行了,而且,分页会自动显示出来,也不需要依靠在其它数值数据。预设履行反回数值,取决于 SetAutoPageBreak() 的模式选择。这个功能是会自动处理的,也不需要其它程序操控。

例子

这个功能,对于有三个字段编排的页面是无有作用的:

class PDF extends FPDF
{
var $col=0;

function SetCol($col)
{
    //Move position to a column
    $this->col=$col;
    $x=10+$col*65;
    $this->SetLeftMargin($x);
    $this->SetX($x);
}

function AcceptPageBreak()
{
    if($this->col<2)
    {
        //Go to next column
        $this->SetCol($this->col+1);
        $this->SetY(10);
        return false;
    }
    else
    {
        //Go back to first column and issue page break
        $this->SetCol(0);
        return true;
    }
}
}

$pdf=new PDF();
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
for($i=1;$i<=300;$i++)
    $pdf->Cell(0,5,"Line $i",0,1);
$pdf->Output();

參見

SetAutoPageBreak().

索引