-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
The page break isn't working before/between titles. It does work here after the title and before the text.
$section->addText('Ut lacinia vehicula odio ac faucibus.');
$section->addPageBreak();
$section->addTitle('First Title');
$section->addPageBreak();
$section->addTitle('Second Title');
$section->addPageBreak();
$section->addText('Ut lacinia vehicula odio ac faucibus.');
The page break also has issues working before/between tables. It works after the second table when the next element is text.
$tableStyle = array('borderSize' => 1);
$width = 2000;
$cellStyle = array('borderSize' => 1);
$section->addText('A line before the table');
$section->addPageBreak();
$firstTable = $section->addTable($tableStyle);
$firstTable->addRow()->addCell($width, $cellStyle)->addText('First Table');
for ($i = 0; $i < 5; $i++)
{
$firstTable->addRow()->addCell($width, $cellStyle)->addText('Cell');
}
$section->addPageBreak();
$secondTable = $section->addTable($tableStyle);
$secondTable->addRow()->addCell($width, $cellStyle)->addText('Second Table');
$section->addPageBreak();
$section->addText('A line after the table');