We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words NullReferenceException when converting WordML document to PDF

Hi,

I’m getting a System.NullReferenceException when trying to convert a Word 2003 (WordML) document to PDF. The documents opens fine in MS Word 2003. I’m using Aspose.Words 13.1.0 running under Mono on Linux. The conversion code is mainly

Document doc = new Document(inputFile);
doc.Save(outputFile, SaveFormat.Pdf);

and works fine for a lot of other documents which look similar. The stack trace with the exception I'm getting:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at x4adf554d20d941a6.x5c28fdcd27dee7d9.x6af07e13bc41d733 (x4adf554d20d941a6.x56410a8dd70087c5 x5906905c888d3d98) [0x00000] in :0
at x4adf554d20d941a6.x5c28fdcd27dee7d9.x47dd32fbd2647bf6 () [0x00000] in :0
at x4adf554d20d941a6.x5c28fdcd27dee7d9.x9ec60fbbaa3117a2 () [0x00000] in :0
at x4adf554d20d941a6.x9b9129deff8239b5.x5f21ccf084377ea8 (Aspose.Words.Fields.Field xe01ae93d9fe5a880) [0x00000] in :0
at xfbd1009a0cbb9842.xdac068096ca09318.x3f88a25febd23896 (Aspose.Words.Fields.Field xe01ae93d9fe5a880) [0x00000] in :0
at xfbd1009a0cbb9842.x5e36356bc92c609b.x803fdc6662fa3f31 () [0x00000] in :0
at xfbd1009a0cbb9842.x454fffaf703e5e86.x83bcdf1790545fdb () [0x00000] in :0
at Aspose.Words.Fields.Field.x42a25ae95099edb8 (xfbd1009a0cbb9842.x5e36356bc92c609b x0f7b23d1c393aed9) [0x00000] in :0
at Aspose.Words.Fields.Field.x295cb4a1df7a5add (xfbd1009a0cbb9842.x5e36356bc92c609b x0f7b23d1c393aed9) [0x00000] in :0
at Aspose.Words.Fields.Field.xda55dc11084967d0 (xfbd1009a0cbb9842.xdac068096ca09318 xb4edacb3d605f604) [0x00000] in :0
at x4adf554d20d941a6.x5c28fdcd27dee7d9.x295cb4a1df7a5add (Aspose.Words.Fields.Field xe01ae93d9fe5a880) [0x00000] in :0
at x4adf554d20d941a6.x5c28fdcd27dee7d9.x295cb4a1df7a5add () [0x00000] in :0
at x4adf554d20d941a6.x4e2f8bff72d83f71.x836cc4d43484aecd (x4adf554d20d941a6.xac6c82c74ce247fb x2612f62f94df47de) [0x00000] in :0
at x4adf554d20d941a6.x4e2f8bff72d83f71.x84448f134fcddce5 (x4adf554d20d941a6.x398b3bd0acd94b61 xd7e5673853e47af4, System.Collections.Hashtable x9883c720593ff2cd) [0x00000] in :0
at x4adf554d20d941a6.x4e2f8bff72d83f71.x17e48e42e094d16c (x4adf554d20d941a6.xa268fdb9ca040dde xd07ce4b74c5774a7) [0x00000] in :0
at x4adf554d20d941a6.x4e2f8bff72d83f71.xc3819e13f60dd8e6 () [0x00000] in :0
at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98 (Aspose.Words.Document x3664041d21d73fdc, x59d6a4fc5007b7a4.xdeb77ea37ad74c56 xdfde339da46db651) [0x00000] in :0
at Aspose.Words.Document.UpdatePageLayout () [0x00000] in :0
at Aspose.Words.Document.x410db0f4a89a6ef1 (Boolean x24af0daafcd8fb8c) [0x00000] in :0
at Aspose.Words.Document.get_xcde671c53995c411 () [0x00000] in :0
at Aspose.Words.Document.get_PageCount () [0x00000] in :0
at xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553 (x28925c9b27b37a46.x8556eed81191af11 x5ac1382edb7bf2c2) [0x00000] in :0
at Aspose.Words.Document.xf381a641001e6830 (System.IO.Stream xcf18e5243f8d5fd3, System.String xafe2f3653ee64ebc, Aspose.Words.Saving.SaveOptions xc27f01f21f67608c) [0x00000] in :0
at Aspose.Words.Document.Save (System.String fileName, Aspose.Words.Saving.SaveOptions saveOptions) [0x00000] in :0
at Aspose.Words.Document.Save (System.String fileName, SaveFormat saveFormat) [0x00000] in :0
at arc2word2pdf.MainClass.Main (System.String[] args) [0x00000] in :0


I can of course provide the Word file, but I would prefer to not post it publicly. Would it be possible to send the file to someone via PM or e-mail?

Thanks a lot!

Philipp

Hi Philipp,

Thanks for your inquiry.

Unfortunately, it is difficult to say what the problem is without the document. I need your document to reproduce the problem on my side. Please note that it is safe to attach files in the forum. If you attach your document here, only you and Aspose staff members can download it. You can also send the file to my email as described here:
http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

Moreover, you can also remove any sensitive information by replacing it with dummy data instead.
Best regards,

Hi,

I didn’t know that attached files were not visible to everyone. I now edited the original post and attached the problematic WordML file.

Thanks for your help!

Philipp

Hi Philipp,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.1.0, I managed to reproduce this exception on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-7751. Your request has also been linked to this issue and you will be notified as soon as it is resolved.

Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-7751) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.