Page 1 of 1

Merging docx files with page numbers

PostPosted: Fri Jul 29, 2011 9:50 pm
by dickyho
Hello,

I am evaluating the MergeDocx utility by merging a few docx files with page number.
What I want to achieve is to have the merged docx file to retain its original documents' page number / total page number.

However the default behavior of MergeDocx will put a single continuous set of page number to the merged document.

Are there any tricks to solve the issue? Thanks.

Re: Merging docx files with page numbers

PostPosted: Fri Jul 29, 2011 11:43 pm
by jason
Hi,

From the documentation:

Suppose you are merging docx1 and docx2, and showing page numbers or cross referencing to page numbers.

Unless docx2 explicitly restarts page numbering, the numbers will continue on from those in docx1.

You can make the page numbering restart with: blockRange2.setRestartPageNumbering(true);

If you are using page numbering of the form "page n of <total pages>" and you want <total pages> to reflect the number of pages in the relevant original document (rather than the number of pages in the resulting merged document), you should change your source documents so that they refer to <Total Number of Pages in Section>. See further http://support.microsoft.com/kb/191029
This will work provided each source docx has a single section. If the source documents have multiple sections, you will need to put a bookmark on the last page of each, and use a reference to that as the total number of pages.



Is that what you are asking? Feel free to email me at jharrop@plutext.com if you have any further issues/queries.

cheers .. Jason

Re: Merging docx files with page numbers

PostPosted: Mon Aug 01, 2011 6:01 pm
by dickyho
Thanks. The problem is solved.