Forum


Replies: 7   Views: 1207
Add pagination and contents to the footers replacing them in an existing 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 admin  · 12-01-2022 - 17:22

Hello,

UPDATE: addHeaderSection and addFooterSection allow adding headers and footers per section. These methods include the removeOthers option to keep or remove existing headers and footers when adding new ones.

importHeadersAndFooters remove existing headers/footers to add the imported ones. There's no method to add new headers and footers keeping existing ones in a DOCX document. A custom development should be done for this specific task.

Using template methods you can replace placeholders in headers and footers (and also other targets: document, footnotes, comments...). Using DOCXPath you can add, remove and replace contents in the main document, headers and footers; but headers and footers must exist to be able to change them.

Regards.