Replies: 3   Views: 943
Merge docx
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 geofhoch  · 18-10-2021 - 13:13


Is it possible to merge two docx without the header but with the footer of the first document ?


Posted by admin  · 18-10-2021 - 13:20


The mergeDocx method doesn't include an option to remove specific headers/footers (only to keep or not the sections to be merged).

You can remove headers/footers before merging the documents. You can use removeHeaders/removeFooters to remove headers and footers, or DOCXPath (removeWordContent) to remove specific contents in a DOCX.


Posted by geofhoch  · 18-10-2021 - 14:38

Thank you for your reply.

But i want to remove header only on the last page of document. Is it possible to remove the header on a specific page ? (I want to keep the pagination of the footer)

Posted by admin  · 18-10-2021 - 15:07


Internally, DOCX documents work with section not pages. A section can include headers and footers (default, first and even); and each section can fill one or more pages (or even a page can has more than one section) when the document is opened (using MS Word, LibreOffice, OneOffice, Google Docs...).

You can use removeWordContent to remove specific contents in a DOCX, for example the existing headers in a specific section.