Problem with Images in PDF

having the same issue also on version 19.7 (java), attaching both original word document and result pdf.
thanks.

String FilePath = “C:\temp\”;
String FileName = FilePath + “my report (2).docx”;
Document doc = new Document(FileName);
doc.save(FilePath + “Document.Doc2PdfSave Out.pdf”, SaveFormat.PDF);

convert to pdf images problem.zip (1.5 MB)

@danielshmaya,

After an initial test with the latest version of Aspose.Words for Java i.e. 19.7, we were unable to reproduce this issue on our end (please see awjava-19.7.pdf (830.0 KB)). We tested on Windows 10 machine (Java 8). Can you please also share your OS and JDK versions and any other environment details which will help us to reproduce the same problem on our end?

same here, win 10, java 8 (jdk1.8.0_201) runnig on intellij .
the only difference (maybe) is that I’m using trial 19.7 version,
(currently I have only 18.2 license so I wanted to make sure it’s not version related issue)

@danielshmaya,

The evaluation version of Aspose.Words for Java (without a license specified) provides full product functionality, but there are a few limitations; for example, it inserts an evaluation watermark at the top of the document on open and save, and limits the maximum document size to several hundred paragraphs.

If you want to test Aspose.Words for Java without the evaluation version limitations, you can also request a 30-day Temporary License. Please refer to How to get a Temporary License?

Also, please check:

As you wrote it should work the same beside the limitations and if not there is a bug in evaluation verison which I don’t think is the case.
any other idea why it happen.
when converting to pdf the same file directly from word application it works, but when using the code I mentioned above in this thread I get the problamtic result.

@danielshmaya,

Please refer to the ‘Additional Dependencies’ section of System Requirements page.
Installing Native JAI and ImageIO on Windows

Hope, this helps:

looks like proxy issue, when the image is referenced to unreachable place while generating the pdf document, it will not add it properly, but in msword it set only the link of the image and in this case when opening the word document it tries to fatch the images online.
in my case the environment that created the document worked under proxy restriction,
but the environment I used to open the word\pdf document wasn’t.
so in the pdf document case which embeding the linked picture at the time it was under the proxy, the document was created without the images, but the word documant was created under proxy and saved only the url (link) of the imagaes, and while it was opened in non proxy restricted environmant he was able to fatch the images.
hope I was clear enough.

thanks again for your fast responsivity.

@danielshmaya,

You need to implement IResourceLoadingCallback interface. Please try using the codes from the following pages to connect to proxy server and get image bytes. You just need to pass returned bytes to the ResourceLoadingArgs.SetData method.

Connect through a Proxy
HTTP URLConnection with proxy in Java