Reputation: 1359
i have a problem with creating a page break in a loop using html2pdf v4.03
.
I have tried:
$pdf = new HTML2PDF('P', 'A4', 'de', true, 'UTF-8');
$output = "";
for (...) {
$output = '<div style="page-break-after: always;">' . $i . '</div>';
}
$pdf->WriteHTML($output);
$pdf->Output('file.pdf', "D");
And also:
$pdf = new HTML2PDF('P', 'A4', 'de', true, 'UTF-8');
$output = "";
for (...) {
$output = '<div>' . $i . '</div><!--NewPage-->';
}
$pdf->WriteHTML($output);
$pdf->Output('file.pdf', "D");
I also tried:
<pagebreak/>
<?page-break>
(i found this here: here)
No solution is working. Has anyone a idea how it can be done?
Upvotes: 1
Views: 7520
Reputation: 132
You can create an unlimited number of new page
s.
In this instance:
for (...) {
$output = '<page>' . $i . '</page>';
}
That should do the trick.
Upvotes: 3