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

Free Support Forum - aspose.com

NullReferenceException when saving DOCX to PDF with MemoryOptimization enabled


The attached document is causing a NullReferenceException when saving to PDF and SaveOptions.MemoryOptimization is enabled, using Aspose.Words for NET 19.8. If SaveOptions.MemoryOptimization is not enabled, it saves correctly.

File: input.zip (25.4 KB)


var doc = new Aspose.Words.Document("input.docx");
var saveOpts = new Aspose.Words.Saving.PdfSaveOptions();
saveOpts.MemoryOptimization = true; // crash when true, ok when false
doc.Save("output.pdf", saveOpts);

If MemoryOptimization is set false (or not specified), it saves correctly. Can this please be fixed?

Thank you


We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19069. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-19069) have been fixed in this Aspose.Words for .NET 19.11 update and this Aspose.Words for Java 19.11 update.

I have re-tested and confirm that the update has solved the issue - thank you!


Thanks for your feedback. In case you have further inquiries or need any help in future, please let us know.