Wrong page number when convert page number to static text

Hi, I’m using Aspose.Word version 10.4.0.0 and I need to convert the page number to static text so that it does not mess up when I combine several Doc files together.I submitted the post before and were guided to use function ConvertFieldsToStaticText(master, Aspose.Words.Fields.FieldType.FieldNumPages); or RemoveFieldLink(master, Aspose.Words.Fields.FieldType.FieldNumPages); (attached files). After doing all the replace merge fields steps, I run: master.UpdateFields() and then I saved the result as test1.doc (attached), the page number still good (1 of 31), but after to run either above function ConvertFieldsToStaticText or RemoveFieldLink, I saved the result as test2.doc (attached), the page number became (1 of 32) even though I have only 31 pages.
Thanks a lot for your help.
Tom

Hi Tom,
Thanks for your request. The problem probably occurs because Aspose.Words’ layout engine improperly renders the document. That is why Aspose.Words returns incorrect page number. I checked the issue with the latest version, and found that result is even worse, on my side, there is some problem with table on the 7th page. Since this problem, Aspose.Words returns 56 pages. I logged this problem to our defect database. We will let you know once it is resolved.
Best regards,

Any update on fixing this? I am encountering this issue even in the very latest build.

I fixed it by re-edit the Word doc. I removed the tables inside the table, and keep the table in 1 level only. It worked for me.

Hi Tom,

Thanks for the additional information. It is perfect that you managed to achieve what you were looking for. Moreover, your issue (WORDSNET-5638) has now been analyzed. We will inform you as soon as it is resolved.

Best Regards,

The issues you have found earlier (filed as WORDSNET-5638) have been fixed in this Aspose.Words for .NET 23.12 update also available on NuGet.