6
我有這個循環打印6行(多單元)約30次。問題是,當它到達底部頁面時,它從多單元打印2或3行,並在下一頁打印其他3行。如果當前頁面上的所有6行沒有足夠的空間,我想讓它在下一頁上打印所有6行。我使用此代碼:fpdf分頁問題
$height_of_cell = 60; mm
$page_height = 279.4; // mm (portrait letter)
$bottom_margin = 20; // mm
$space_left = $page_height - $p->GetY(); // space left on page
$space_left -= $bottom_margin; // less the bottom margin
if ($height_of_cell >= $space_left) {
$p->Ln();
$p->AddPage(); // page break
$p->Cell(100,5,'','B',2); // this creates a blank row for formatting reasons
}
但它不起作用。任何解決方案謝謝!
嗨,我修改了這樣的代碼,但它什麼也沒做。你在某處看到錯誤嗎? –
我想通了。它正在工作。 –
GReat - 只是編輯我的答案以進一步提供幫助:) – Mark