Individual page numbers for different sections

Hi,

I have several Word documents (templates) and I merge them together into one pdf document using aspose. The problem is, each template should have separate page numbers and then restart again.

I set RestartPageNumbering to “true” however, it only half worked.

The templates need to be numbered as “Page x of y”. When I set the RestartPageNumbering to “true” it works for the first part(so for x). The thing is, the last number (of y) is still the number of the total amound of pages in the whole pdf document.
Say I had 2 documents - one has three pages one has two. The page numbering goes as follows:

Page 1 of 5
Page 2 of 5
Page 3 of 5
Page 1 of 5
Page 2 of 5

Do you know how I could get it to do:

Page 1 of 3
Page 2 of 3
Page 3 of 3
Page 1 of 2
Page 2 of 2

?

Kind regards!

@Nathat10

Thanks for your inquiry. Please check following documentation link to retain the multiple page number scheme in document merging. It will help you to accomplish the task.

Retaining Multiple Page Numbering Schemes

Hi,

I was wondering if you could help me too! I have a similar problem. I have several Word documents (templates) and I merge them together into one pdf document using aspose. The problem is, each template should have separate page numbers and then restart again. Your solution worked with the RestartPageNumbering (I set it to true) however, it only half worked.

The templates need to be numbered as “Page x of y”. When I set the RestartPageNumbering to “true” it works for the first part(so for x). The thing is, the last number (of y) is still the number of the total amound of pages in the whole pdf document.
Say I had 2 documents - one has three pages one has two. The page numbering goes as follows:

Page 1 of 5
Page 2 of 5
Page 3 of 5
Page 1 of 5
Page 2 of 5

Do you know how I could get it to do:

Page 1 of 3
Page 2 of 3
Page 3 of 3
Page 1 of 2
Page 2 of 2

?

Kind regards!

It helps but now I get a message saying:

System.InvalidOperationException

Message:
The node must be a paragraph or an inline node.

And I don’t really understand exactly what that means…

Do you have any tips for me?

@Nathat10

Thanks for your feedback. We will appreciate it if you please share your input documents along with sample console application(without compilation errors) as ZIP file. We will test the scenario and will guide you accordingly.