Table of Content error when using Aspose Word.Net v 25.2.0

I’m getting the error message “Object not in the list” when saving with word document as PDF in Aspose.Word 25.2.0.

I isolate the issue to a specific Table of Contents portion and I can reproduce the issue with just this table of contents.

Is this a known issue with the Aspose.Word 25.2.0 release?

@jacmac Could you please attach your problematic input and output documents here for testing? We will check the issue and provide you more information.

Hi Alexey, sorry for the late reply.
Please find sample document attached.
sample toc.docx (66.4 KB)

Additionally, I can confirm reverting back to v25.1.2 solves my issue.

@jacmac Thank you for additional information. Unfortunately, I cannot reproduce the problem on my side. I tested with both 25.2 and the latest 25.3 versions and I can successfully convert your document to PDF using the following simple code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");

Hi Alexey,

I’m still having the same problem with Aspose Word.net 25
Unfortunately it’s classified document so I can’t freely share it with you.
I’ll try to isolate the problematic part and send it over.

Regards.

@jacmac Unfortunately, it is impossible to analyze the problem without the document. We will wait for material for analysis from you.

Hi Alexey,

I’ve Isolated the problematic parts.
I’m aware it’s a missing refs issue; however, it’s only throwing exception in version 25.2+ and generated with no issue in 25.1.
template error.docx (59.4 KB)

@jacmac Thank you for additional information.

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-28015

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.

PS: The problem is reproducible only if call Document.UpdateFields method explicitly before saving to PDF. Usualy this is not required, since fields are automatically updated upon rendering documents. So you can use the following code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");