Image is lost after DOCX to PDF conversion using .NET

Hello,

We’ve recently noticed some rendering issues of embedded images during conversion from Word to PDF. I’m attaching sample input and output documents. As you can notice in PDF, some lines of embedded image are lost. Our customers started complaing on this, so I would like to ask you for investigation.

There is fragment of code which we use for conversion:

  private void Convert( MemoryStream input, MemoryStream output )
  {
  	Document document = new Document( input );
  	PdfSaveOptions options = new PdfSaveOptions()
  	{
  		Compliance = PdfCompliance.Pdf15
  	};
  	document.Save( output, options );
  }

According to your API docs, by default PdfSaveOptions object should have ImageConversion property set to Auto, and JpegQuality equal to 100. This should give us best quality results during conversion. I’ve found in your documentation that there might occur a little compression if embedded image is not JPEG. Because of this graphic has very thin lines, even slight decrease of quality could result with losing some of them. Are my suspicions correct? If so, can I somehow solve it by changing my code? Any advice is appreciated.

sample files.zip (157.7 KB)

Thanks,
Igor Paszewski

@igor.paszewski

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20399 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@igor.paszewski

It is to inform you that the fix of WORDSNET-20399 issue will be available in the October 2020 release. However, you will get notification of this issue in September 2020 release that is wrong. We have created new issue as WORDSNET-21080 in our issue tracking system so that you will get notification of fixed issue.

The issues you have found earlier (filed as WORDSNET-20399) have been fixed in this Aspose.Words for .NET 20.9 update and this Aspose.Words for Java 20.9 update.

I’ve downloaded latest version (20.9) and I didn’t notice any significant improvement. The issue still exists. I’ve converted sample document which were attached to my first post and embedded image was still incomplete in the output PDF. Should I somehow adjust PdfSaveOptions properties in order to avoid losing fragments of embedded images?

@igor.paszewski

The issue WORDSNET-21080 has been resolved and its fix will be available in the next version of Aspose.Words 20.10. We will inform you via this forum thread once new version of Aspose.Words is available.

The issues you have found earlier (filed as WORDSNET-21080) have been fixed in this Aspose.Words for .NET 20.10 update and this Aspose.Words for Java 20.10 update.