Saving to PDF in 24.6.0 is throwing a null reference exception in 24.6.0 for some documents. They work fine in 24.5.0.
System.NullReferenceException: Object reference not set to an instance of an object.
at AUc.v()
at AUc.d(Document d)
at JUY.d(Paragraph d)
at JUY.d(Node d)
at WU7.T()
at WU7.M()
at WU7.b()
at WU7.MoveNext()
at kUZ.c()
at Aspose.Words.Document.UpdatePageLayout()
at Aspose.Words.Document.d(Boolean d)
at Aspose.Words.Document.z()
at Aspose.Words.Document.get_PageCount()
at sUz.v(rCK d, Fd v)
at sUz.eUciFd(rCK d)
at NUQ.NUQiFd(rCK d)
at Aspose.Words.Document.d(rCK d)
at Aspose.Words.Document.d(Stream d, String v, SaveOptions c)
at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
var doc = new Document(Stream);
var pdfStream = new MemoryStream();
var saveOptions = SaveOptions.CreateSaveOptions(SaveFormat.Pdf);
saveOptions.MemoryOptimization = true;
doc.Save(pdfStream, saveOptions);
null-reference-in-26.docx (22.0 KB)