Answer the question
In order to leave comments, you need to log in
PHPWord - how to move a block to the next page if it is not included on the current one?
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addTitle('blablabla');
$section->addText('blablabla');
$section->addTitle('blablabla');
$section->addText('blablabla');
...
$section->addTitle('blablabla');
$section->addText('blablabla');
The page ends, the title stays on one, and the text wraps to the next.
And you need to transfer both blocks to the new one.
The method with "stuffing" empty lines will not work, because the size of the blocks is not known in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question