Forum


Replies: 2   Views: 699
Enforcesectionpagebreak is not working
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 12-02-2021 - 17:02

Hello,

Thanks for sending the requested DOCX. We have done some tests with your document. Although the nextPage option applied to a section is not fully supported in LibreOffice, so it can't force a section break, regular sections as your DOCX uses, generate a section break automatically in MS Word and LibreOffice (enforceSectionPageBreak is more focused to be used when you are merging DOCX that has continuous section as default and it want to be changed when doing the merging).

After checking your DOCX, the problem is that LibreOffice requires starting the documents with a paragraph to handle section breaks automatically correctly, and your document starts with two tables with an absolute position (anchor set to page instead of paragraph), so LibreOffice has some limitations when generating the automatic section breaks.

Due to the restrictions of LibreOffice, you can use the following approaches to get the same output in MS Word and LibreOffice:

  • Add a paragraph before the first table (for example with the minimal size to get the same layout). And we also recommend changing the table anchor to paragraph instead of to page.
  • Force a section break at the bottom of the document.

Regards.