Upon upgrading certain images are not being shown when converting to docx to pdf

We have an application that was using 9.7 of the Aspose.Words.dll, when converting docx files to pdf we had images convert over just fine. Upon upgrading to the latest version (14.2.0.0) some of the images are no longer being shown in the pdf. I have attached an example solution that converts the docx in question to pdf.

Hi Patrick,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your document to Pdf using MS Word, you will get the same output. I have attached the output Pdf files with this post for your kind reference.

Please note that every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes. Please upgrade to the latest version of Aspose.Words for .NET 14.3.0.

Actually if you notice there is a difference between the two pdf’s you provided, the one named output.pdf contains none of the images for each of the quote lines. But the MSWordOut.pdf contains one of the images but it is zoomed in and doesn’t look right. I downloaded 14.3 and see the same result.

I have attached a pdf of the converted document using version 9.7 of Aspose.Words.dll. This is what we are expecting the resulting pdf to look like and has worked for us for awhile now. We would continue using 9.7 but there are other bugs which are forcing us to upgrade to the latest version of Aspose.Words.

Hi Patrick,

Thanks for your inquiry.

As I shared in my last post, Aspose.Words mimics the same behavior as MS Word does. If you convert your document to Pdf using MS Word, you will get the same output.

Yes, the older version of Aspose.Words (v 9.7) render the images in output Pdf. However, this does not mimics the MS Word behavior.

In your case, I suggest you please use the following code example to achieve your required output. Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "Q1Quote.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
foreach(DrawingML dml in doc.GetChildNodes(NodeType.DrawingML, true))
{
    MemoryStream stream = new MemoryStream();
    dml.GetShapeRenderer().Save(stream, new ImageSaveOptions(SaveFormat.Png));
    builder.MoveTo(dml);
    builder.InsertImage(stream);
    dml.Remove();
}
doc.Save(MyDir + "Out.pdf");

I appreciate the code you provided but unfortunately our customer is not going to accept it as it makes the images look like junk compared to what they had before.

The point I was trying to make in my previous post is that Aspose docx to pdf conversion is not one to one with what Microsoft Word is doing as you can tell by the attached screenshot (the right side is the output from Microsoft Word). Both don’t do what we need them to do.

As a developer I can understand functionality changing and bugs being introduced from version to version of a product, but it is a little frustrating when something like this happens and you are told that it is not a bug. Since the functionality changed the only option I have right now, based on the responses I have been getting, is to start evaluating other libraries that can handle the conversion in the manner we need it to happen.

Hi Patrick,

Thanks for sharing your concerns. Yes, MS Word renders only one image (DrawingML node) which is not complete image as shown in Word document. Aspose.Words does not render all images (DrawingML nodes).

I have logged this issue in our issue tracking system as WORDSNET-9966 for investigation. Our development team will check the possibility of the implementation for this issue. We will update you via this forum thread once there is any update available on this issue.

We apologize for your inconvenience.

Thanks Tahir, I appreciate it.

Tahir, has there been any status updates to this case?

Hi Patrick,

Thanks for your inquiry.

I would
like to share with you that issues are addressed and resolved based on
first come first serve basis. Currently, your issue is pending for
analysis and is in the queue. We will update you via this forum thread
once there is any update available on your issue.

Thank you for your patience.

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

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

Awesome! Works great. Thanks for the fix!