We’ve got an issue with Aspose.Words failing to save a specific document to pdf. Code duplicating the issue is as follows…
static void Main(string[] args)
{
var doc = new Document(args[0]);
var destFileName = Path.GetFileNameWithoutExtension(args[0]) + ".pdf";
var format = Aspose.Words.Saving.SaveOptions.CreateSaveOptions(destFileName).SaveFormat;
doc.Save(destFileName, format);
}
This is the document that produces the issue Chart_Issue.docx (37.7 KB). When the above code is executed passing this document as the argument it fails with a NullReferenceException on the call to Document.Save.
The above document is a cut down copy of a client document, it’s worth noting that there were a number of charts in the original document, it was this single chart inside the above document that seems to be responsible for the issue. We don’t know why there was an issue with this specific chart.