DOCX to PDF conversion throws NullReferenceException using .NET

The attached word document contains a single image, that would be generated in PDF (with a strange gray-ish background) with aspose.words 11.1.0, (also attached) but which now causes an exception to occur with aspose.words 11.3.0.

As this used to work with a previous version, it is getting harder to convince my client that Aspose was the right tool for the job. 11.1 didn’t support (all) math object rendering in PDF, which was a serious showstopper. This has now been fixed in 11.3, and suddenly the component chokes on an image that previously worked. Suffice to say, my client isn’t happy and not very impressed. Is there any chance you can look into this problem right away? I have no idea why that image is different from other images that apparently convert to PDF just fine - maybe you can see that? It is the only image within their 500+ documents that causes this error, so a workaround could be to identify the exact nature of the problem and just avoid that.


This code

string inputFilename = “image input.docx”;
string outputFilename = “image input.pdf”;
Document doc = new Document(Path.Combine(Directory.GetCurrentDirectory(), inputFilename));
DocumentBuilder builder = new DocumentBuilder(doc);

try
{
doc.Save(Path.Combine(Directory.GetCurrentDirectory(), outputFilename), SaveFormat.Pdf);
}
catch (NullReferenceException ex)
{
Console.WriteLine(“error”);
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);

}

Causes this exception

error
Object reference not set to an instance of an object.
at xf84f8427dc22d095.xf796701adb7bc194.VisitPathStart(xab391c46ff9a0a38 path)

at x1c8faa688b1f0b0c.xab391c46ff9a0a38.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at xf84f8427dc22d095.xf796701adb7bc194.x550781f8db1cf5f2(x4fdf549af9de6b97 x5
f50d4ed5375c1fe, x2bfc048c6117997a[] x45bd840e09b7c920)
at x1c8faa688b1f0b0c.x72c34b8dbaec3734.xdb6e5b78ff4fa348(Boolean x34c8462e7ee
61121, x48cb59b8ec3b78c9 x5a7a657dd8463d3b, Boolean xac51bc46b01ec35d, xf51865b8
3a7a0b3b x672ff13faf031f3d)
at x1c8faa688b1f0b0c.x72c34b8dbaec3734.x9214b18190604b0d(xf51865b83a7a0b3b x6
72ff13faf031f3d, x48cb59b8ec3b78c9 x5a7a657dd8463d3b, Boolean xac51bc46b01ec35d,
Boolean x34c8462e7ee61121)
at x4f4df92b75ba3b67.x92faf2a956f0f5a7.VisitImage(x72c34b8dbaec3734 image)
at x1c8faa688b1f0b0c.x72c34b8dbaec3734.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xc67adcdbca121a26.Accept(xf51865b83a7a0b3b visitor)
at x6a671772ec29137f.xcd769e39c0788209.DoRenderPage(xc67adcdbca121a26 page)
at xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x8556eed81191af11 x5
ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String x
afe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at Aspose.Words.Document.Save(String fileName, SaveFormat saveFormat)
at AsposeErrorLab.Program.Main(String[] args) in D:\Projects!- Labs\AsposeEr
rorLab\AsposeErrorLab\Program.cs:line 23


Hi Jan,

Thanks
for your query. I have managed to reproduce the same issue at my end. I
have logged this issue in our issue tracking system. You will be
notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,

Any news on this error yet?

Best regards

Jan Hansen

Hi Jan,

I have verified the status of this issue from our issue tracking system. I like to share with you that our development team has completed the analysis of this issue. This issue is under development phase now. Hopefully, this issue will be fixed by the end of next month.

We really appreciate your patience.

The issues you have found earlier (filed as WORDSNET-6340) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.