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

Free Support Forum - aspose.com

Issue converting Word Document containing a chart to a PDF

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.

@support-1 With the latest 22.4 version of Aspose.Words exception does not occur and document is saved to PDF. However, I have noticed that trendline label of the chart is not rendering with Aspose.Words, this problem has been logged as WORDSNET-23801. We will let you know once it is resolved.
So, please try using the latest version of Aspose.Words to avoid the exception.