Converting .docx to .pdf results in different content and incorrect page numbers in the table of contents

Converting .docx to .pdf when a table breaks across pages results in different output in the PDF including incorrect page numbers in the table of contents. I am using Aspose.Words for .NET version 19.1.

In the resulting PDF (IncorrectPageNumbers_Aspose.pdf) you will see that sections 2, 3, and 4 say they are on page 5, but there are only 4 pages in the document. They were on page 5 in the original Word document (CorrectPageNumbers.docx). The conversion to PDF seems to have affected if the table fit on the page. The table should have matched what it was in Word and then I think the page numbers would be correct.

To do the conversion, I am just loading the document and saving as pdf:

Document doc = new Document("CorrectPageNumbers.docx");"IncorrectPageNumbers_Aspose.pdf");

I have included my input document and the output I am getting from Aspose. I have also included the file “CorrectPageNumbers_Word.pdf” which is the result using Word directly to produce the PDF. (128.2 KB)


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18439. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Has this issue been fixed in any new versions of Aspose.words?

@aayush97 Unfortunately, the issue is not resolve yet. Currently it is postponed and is not yet scheduled for development. Please accept our apologies for your inconvenience.