NullReferenceException when converting from DOCX to PDF with Aspose.Words

Hi,

Sometimes when there is an image inside a table in a docx document, a call to document.Save in order to convert to PDF fails with a NullReferenceException. It seems to be related to the page layout since there is a call to Aspose.Words.Document.UpdatePageLayout() in the call stack.

I’ve attached a zip file containing a docx file with which the issue occurs and a notebook (.ipynb file) containing instructions and C# code to reproduce the issue.

AsposeWordsNullRef.zip (132,2 Ko)

@bNobo
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-27686

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.

Hello,

I made further tests and discovered that removing tab stops in the docx file “solve” the problem. Just removing this element from document.xml

<w:tabs>
    <w:tab w:val="decimal" w:leader="dot" w:pos="8505" />
</w:tabs>

and the problem go away. Maybe this information could help you investigating the issue.

@bNobo Thank you for the additional information. The issue has already been resolved in the current codebase, and the fix will be included in the upcoming Aspose.Words 25.3 release. We will notify you once it is published.

1 Like

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