Forum


Replies: 1   Views: 223
Add page number to merging
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 anushkapachpute  · 21-06-2024 - 11:02

Actually I am merging multiple documents, so while merging I want to add page numbers, can you tell me how can I add? also what are requirements, is pagenumber should be present before merging

Posted by admin  · 21-06-2024 - 11:37

Hello,

You can add page numbers using addPageNumber. Please note that addHeader and addFooter methods add headers and footers in all sections of the DOCX. If you need to add headers and footers per section you can use addHeaderSection and addFooterSection methods.

Using template placeholders, you can replace existing placeholders with a WordFragment that includes page number content with replaceVariableByWordFragment. Or use insertWordFragment to add new contents in existing headers and footers without using template placeholders.

Page numbers can be added in the DOCX to be merged and in the merged DOCX output.

Regards.