1. AcceptPageBreak - 接受或不接受自動分頁 boolean AcceptPageBreak() 版本1.4 內容: 每逢有分頁的情況出現,就代表這個功能已經被執行了,而且,分頁會自動顯示出來,也不需要依靠在其他數值資料。預設履行反回數值,取決於 SetAutoPageBreak() 的模式選擇。這個功能是會自動處理的,也不需要其他程式操控。 例子 這個功能,對於有三個欄位編排的頁面是無有作用的: [php] 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; } } }