Dear Aspose Team
I have a table of content in a word document which contains outdated elements and page numbers. When I call document.updateFields() and document.updatePageLayout() in that order it only renders the last element in the table of contents. Drops the other ones. The page number from the remaining element seems to be correct.
The feature worded fine until version 24.7. From 24.8 onward it shows the broken behavior. I can also provide examples if needed.
Best regards,
Juergen
@juergenwind
It seems you are experiencing an issue with the Table of Contents (TOC) in your Word document after updating to version 24.8 of Aspose.Words. The problem you’re facing, where only the last element in the TOC is rendered while the page numbers appear correct, is indeed concerning.
To address this, it’s important to ensure that you are using the correct sequence of method calls to update the TOC. The recommended approach is to first call document.updateFields()
to populate the TOC entries, and then call document.updatePageLayout()
to ensure that the page numbers are correctly calculated and displayed. If these methods are called in the wrong order, it can lead to incomplete or incorrect TOC entries.
Here’s a brief code example demonstrating the correct usage:
// Load your document
Document doc = new Document("your-document.docx");
// Update the fields in the document
doc.UpdateFields();
// Update the page layout to ensure page numbers are calculated
doc.UpdatePageLayout();
// Save the updated document
doc.Save("updated-document.docx");
If you continue to experience issues after following this approach, it may be beneficial to check if there are any specific changes or bugs introduced in version 24.8 that could be affecting the TOC functionality. Additionally, providing a sample document that replicates the issue could help in diagnosing the problem further.
If you have any more questions or need further assistance, feel free to ask!
Hi,
yes the ordering of the methods is correct. Same behavior is also shown when I only call the update method.
I did look at the release notes and the issues here but did not find anything related to that. So I assume it is a new defect.
@juergenwind Could you please attach your input and output documents here for our reference? We will check the issue and provide you more information.
Have you tried updating TOC in MS Word? Does the problem occur in this case?
Hi Alexey
Can you make the next posts private since the document contains corporate branding?
Yes if I update the references (update table) in MS Word it looks like in the versions prior to version 24.8. Only starting from there it diverges from what MS Word produces dropping elements.
Best regards,
Juergen
@juergenwind It is safe to attach documents in the forum. Only you as a topic starter and Aspose staff can access the attachments.
documents.zip (388.5 KB)
the archive contains the word.xml files (uncompressed word files) simple-test-report-toc.xml contains the outdated TOC simple-test-report-toc-after-update-table-in-word.xml contains how Word updates the TOC when updating the references.
converted-version-24.7.pdf is the document rendered with 24.7 which contains the correctly updated TOC by aspose. converted-version-higher-24.8.pdf contains the wrongly updated TOC from Aspose. I also tried with 24.9 which produced the same result.
With regards to ticket prioritization. I know there is a standard process but we issued a new license because of a feature introduced in 24.8 (options.setUseSdtTagAsFormFieldName(true)) which we cannot use now. Which is a bit unfortunate.
If you need more information, please let me know.
Best regards,
Juergen
@juergenwind
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-27449
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Okay we will look into paid support. I hope since this is a defect it is not needed though.
Do I get notified when it is fixed? Also I noticed
WORDSNET
but we are using words java
Best regards,
Juergen
@juergenwind Sure, we will notify you here in this forum thread once the issue is resolved.
.NET version of Aspose.Words is the main version, so all fixes are first implemented in .NET version and then ported to Java. So the issue mentioned in another thread has been fixed for both .NET and Java versions.
ok thanks! Just one thing to clarify. If I buy “Developer Support” what time frame I am looking at for this to get solved?
@juergenwind I am afraid, there are no fixed time frames. All depends on the issue complexity.
Ok I looked and for the license I would actually need Business Support. I understand that you cannot give out promises but I don’t want to spend 1800$ having the same outlook than without the support. So can I expect something from it?
@juergenwind Paid support allows to push the issue upper in the queue and as a result faster fixes. But it does not 100% guaranteed providing fast fixes. As I have mentioned all depends on the issue complexity.
You are killing me does the paid support at least guarantee me that you look at it and try to analyze the issue in a timely fashion?
@juergenwind We do not have fixed time frames for issue analysis or fixes. Initial issue analysis usually is done within a week regardless of the issue priority.
ok thanks, than I will wait.
1 Like
Hello Team,
I just saw the issue was closed? Is there a fix planned in the next release or do you have any information on this for me?
Best regards,
Juergen
@juergenwind The issue is already resolved. The fix will be included into the next 24.11 version of Aspose.Words. We will be sure to let you know once it is available.
The issues you have found earlier (filed as WORDSNET-27449) have been fixed in this Aspose.Words for Java 24.11 update.