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.

We’re still seeing the issue with the label of the chart and a forumla on the right hand side (y = 0.9065x + 2.6959R² = 0.2421) being missing when converting the word document to a pdf in 22.9. Any update on the issue?

@support-1 This issue is not resolved yet. We will keep you updated and let you know once it is resolved or we have more information for you.

Thanks @alexey.noskov… I’ve created another post for an issue with another document with a similar issue…
The cause might be related to this issue…
https://forum.aspose.com/t/issue-converting-specific-word-document-to-pdf/251579

@support-1 It is not likely this issue is related to the issue you have reported in another you thread, since the issue reported here is related to DML Chart rendering, but the issue in another thread is related to shape rendering.

Can we get an update on this issue.

It’s been 10 months since we reported the problem.

@support-1 The issue is currently in development. It is scheduled to be fixed before the next 23.3 version of Aspose.Words. We will be sure to let you know once it is released.

The issues you have found earlier (filed as WORDSNET-23801) have been fixed in this Aspose.Words for .NET 23.3 update also available on NuGet.

We’ve tested with Aspose Word 23.3 and found whilst it has resolved problems with some documents, the issue still persists in the following document…

<-- removed incorrect document -->
when save is called on the document it produces the following error…

System.NullReferenceException: Object reference not set to an instance of an object.

  Stack Trace: 
   . ()
   . ()
   . ()
   .      ​()
   .      ​ ()
   .      ​()
   .(    )
   .()
   .()
   .()
<33 more frames...>
   .()
Document.UpdatePageLayout()
   .(    ,     )
   .      ​(    )
   .      ​(    )
Document.(    )
Document.(Stream , String , SaveOptions )
WordDocumentOperations.WriteDocumentFile(Stream inputStream, Stream outputStream, String destFileName, Int32 processingFlags) line 177
AsposeWordProcessorTests.WritePDF(Stream outputStream, String sourceFilePath, String destFileName, Int32 processingFlags) line 57
AsposeWordProcessorTests.SL_1770_dhm_nr_po_0331_00() line 144

@support-1 Could you please provide the code that will allow us to reproduce the problem? I have checked using the following code and the latest 23.3 version of Aspose.Words:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");

And no exceptions are thrown on my side.

I would think the code above would suffice.

@support-1 Unfortunately, I cannot reproduce the problem on my side. Here is PDF document produced on my side: out.pdf (184.7 KB)

Sorry wrong document but it’s not letting me upload the right one…

Yet the size of the document is 19.1MB 20,079,802 bytes

OK here’s a link to the document…

dhm-nr-po-0331-00-test.docx

@support-1 Thank you for additional information.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25113

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-25113) have been fixed in this Aspose.Words for .NET 23.4 update also available on NuGet.

Hi thanks for the update. It’s now producing a PDF however it seems the gradation on the vertical axis of the first chart in the document is different in the PDF when compared with the original word document…

Here’s the PDF

Here’s the word document…

Whilst its a technically correct representation of the data in the chart at a glance they look different.

@support-1
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25294

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-25294) have been fixed in this Aspose.Words for .NET 23.6 update also available on NuGet.