Forum


Replies: 1   Views: 116
Add page number to merging

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.