I have a client who is reporting that their TOC page numbers become incorrect after uploading their documents to our application. After some investigation I discovered that this happens after Document.UpdateFields() is called.
We are currently using version 20.2 of Aspose.Words (.NET) in production. I updated my development environment to 20.9 (the latest version at the time of writing) but it did not resolve the issue.
In the zip file that I’m attaching there are two word documents:
- BeforeUpdateFields.docx: The original file, notice that under section 3 of the TOC, reporting concerns is said to be on page 9 which is correct.
- AfterUpdateFields.dox: Notice that reporting concerns is now said to be on page 8 which is incorrect.
Calling Document.UpdatePageLayout() after Document.UpdateFields() did not help. Also, I saw that this can sometimes be caused by not having the correct fonts installed. This document uses the Century Gothic font and I have verified that the font is installed on my development machine.
TOC Issue.zip (161.1 KB)