Replies: 4   Views: 631
Split docx by page
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 LucasSpl  · 19-02-2021 - 11:16


Is it possible to split a docx per page ?
I tried it with the sections and DOCXPathUtilities but impossible to get there


I'm using Premium 11

Posted by admin  · 19-02-2021 - 11:38


splitDocx available in DOCXPathUtilitles allows to split a DOCX per section, but not by page. There's no method in the current stable version to split a DOCX by page.


Posted by LucasSpl  · 19-02-2021 - 12:43

Is there a way to create one section per existing page? addSection seems hazardous
I want to split a existing 3 pages docx


Posted by admin  · 19-02-2021 - 14:17


Internally, DOCX documents work with sections, not pages. A section may fill one or more pages or even less than a page (several sections may fill one page). How many pages have a section is unknown until the DOCX is opened using a DOCX reader (in some cases, distinct DOCX readers may show more or less pages for the same DOCX depending on the contents).

Unfortunately, a DOCX doesn't include a specific tag or content to set a page, only sections. You can do page breaks (addBreak method) and section breaks (addSection method) if needed to separate contents; the previous methods add OOXML tags that can be queried, added, changed, removed...


Posted by LucasSpl  · 19-02-2021 - 14:59

oh... it's annoying

thanks !