Lokomotywa
Lokomotywa

Reputation: 2844

TCPDF - Add Page in case content does not fit on one page

$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetTitle($category->shortName);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 11, '', true);
foreach($html as $htm) {
    $pdf->AddPage();
    $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $htm, $border = 0, $ln = 0, $fill = 0, $reset = true, $align = '', $autopadding = true);
}

The array $html contains content that ususally fits on one page, but sometimes exceed its bonds. For these cases, I want to add an additional page for the overflow. How do I do that?

Upvotes: 1

Views: 626

Answers (1)

Lokomotywa
Lokomotywa

Reputation: 2844

What finally helped was using $pdf->writeHTML instead of $pdf->writeHTMLCell

Upvotes: 0

Related Questions