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

Free Support Forum - aspose.com

Images replaced by red cross in PDF file

Hi,


We are facing a issue in the PDF document with some of the images replaced by a red cross. The images are inserted from a DOC file to a DOCX file and then the PDF file is created using the DOCX document.

In the PDF, the images are replaced by red cross but appears correctly in the Word document (DOCX).

Please note that we have tested the issue with the latest versions of Aspose (Word 16.7.0 and PDF 11.8.0) and the issue remains the same with the latest versions also.

I have attached the generated documents with the latest versions of Aspose. Also, I have attached the Sample.doc with the images to test.

We are using the following code to generate the document:

Document outputDoc = new Document();
Document sampleDoc = new Document(“Sample.doc directory”);
DocumentBuilder tempDocBuilder = new DocumentBuilder(outputDoc);
tempDocBuilder.insertDocument(sampleDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
outputDoc.save(“Directory to save Output.docx”);
outputDoc.save(“Directory to save Output.pdf”);

Also, we have used Java Advanced Imaging (JAI) package jars (JAI core 1.1.3) in the system in which we are generating the documents.

Regards,
Prabhaker Kr.
Hi Prabhaker,

Thanks for your inquiry. We have tested the scenario using shared code example and have not found the red cross image issue. However, an exception is thrown when JAI jar file is used with Aspose.Words. We have already logged this issue as WORDSJAVA-1427 in our issue tracking system. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

We have attached the output Pdf with this post for your kind reference.

Could you please create a simple Java application (source code of Aspose.Pdf and Aspose.Words) that helps us to reproduce your problem on our end and attach it here for testing? Please also share your working environment e.g. operating system, jdk version etc. We will investigate the issue on our side and provide you more information.

Hi Tahir,


I have attached the Java application thorough which we are generating the DOCX & PDF files.

Below are the other details of the working environment:

1. Operating system : Kernal Linux 2.6.32-279.el6.x86_64

2. JDK : java version “1.6.0_35”
Java™ SE Runtime Environment (build 1.6.0_35-b10)


Regards,
Prabhaker Kr.

Hi Prabhaker,


Thanks for your inquiry. We have tested the scenario at Ubuntu using latest version of Aspose.Words for Java 16.7.0 and have not found the shared “red cross” issue. The output Pdf shared in your first post is generated by Aspose.Pdf. Please share the Aspose.Pdf code that you are using at your side. We will further investigate this issue and provide you more information on this.

We have closed WORDSJAVA-1427 as ‘Not a bug’ in our issue tracking system. We faced this exception at Windows 7 due to incorrect configuration of JAI. We suggest you please read following article.
Installing the native JAI and ImageIO

Hi Prabhaker,

Aspose tries to read this image via javax.media.jai.JAI class (jai_core.jar) first.
If it fails (that is why you can see the stacktrace. Unfortunately we can't hide it) then Aspose fallbacks to com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader (jai_imageio-1.1.jar)
So if jai_imageio-1.1.jar is not in classpath then the red cross will be drawn.

Make sure jai_imageio-1.1.jar is installed as well.

Please let us know if it helped.

Thanks

Hi Prabhaker,


Please let us know if the suggested solution helped.

Thanks

The issues you have found earlier (filed as WORDSJAVA-1432) have been fixed in this Aspose.Words for .NET 16.12.0 update and this Aspose.Words for Java 16.12.0 update.


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