Avoid Wrong Page Numbering Issue during Word DOCX with Continuous Sections to PDF Conversion (C# .NET)

Hi, we are having problem with page numbering in a pdf that was converted from word document. we would like the pdf file to restart the page number to a certain page. Word document has the expected and correct page numbers but when aspose.word converts to pdf the page numbers are wrong. I have tried the free online conversion here and it has the same result. Can you please help?

@jhomer.rodas,

Please ZIP and upload your simplified source Word document and Aspose.Words generated PDF file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

thank @awais.hafeez. please see attached. page 58 should be 2 and succeeding pages should continue from 3. See word doc for correct paging. Thanks.aspose wrong page numbering.zip (620.9 KB)

@jhomer.rodas,

We have logged this problem in our issue tracking system with ID WORDSNET-22177. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Thanks, hope the issue would be resolved soon.

@jhomer.rodas,

The issue occurs because Aspose.Words currently does not imitate the current MS Word’s logic/behavior for computing Page numbers in a Continuous Section. We will inform you via this thread as soon as this issue will get resolved in future.

Thanks please keep me posted.

The issues you have found earlier (filed as WORDSNET-22177) have been fixed in this Aspose.Words for .NET 21.6 update and this Aspose.Words for Java 21.6 update.

@jhomer.rodas,

Regarding WORDSNET-22177, it is to inform you that we have introduced a new layout option to control Aspose.Words’ behavior when computing page numbers in a continuous section that restarts page numbering:

After the changes, the default Aspose.Words’ behavior matches the current MS Word version (2019).

Document doc = new Document("input.docx");
doc.LayoutOptions.ContinuousSectionPageNumberingRestart = ContinuosSectionRestart.FromNewPageOnly;
doc.Save("out.pdf");

Note: It is required to rebuild the document page layout (via Document.UpdatePageLayout() method) after changing the Document.LayoutOptions values.

3 posts were split to a new topic: Default ContinuosSectionRestart Enum Value & Associated MS Word Versions