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

Free Support Forum - aspose.com

Images in PDF

I recently upgraded to the newest version of Aspose.Pdf for Java , and although some images are working from a URL, I have had a couple issues with others.

A common error is a pop-up reading “Insufficient data for an image.” when opened using Adobe Reader 9.0. An sample of code that gives this error:

Pdf testpdf = new Pdf();
Section sec1 = testpdf.getSections().add();
aspose.pdf.Image image1 = new aspose.pdf.Image();
image1.getImageInfo().setFile(“http://transportation.ky.gov/progmgmt/images/world.jpg”);
image1.getImageInfo().setImageFileType(ImageFileType.Jpeg);
sec1.getParagraphs().add(image1);
testpdf.save(“test.pdf”);

Also, when reading from another URL (this one is more important as getting images like this to work is critical to a project I’m working on), the application just freezes (I waited for several minutes before halting execution). For this, just use the same code as above but with the URL:
http://images.realtyserver.com/photo_server.php?btnSubmit=GetPhoto&board=bismarck&name=00049911.L08

kpriebe:
I recently upgraded to the newest version of Aspose.Pdf for Java , and although some images are working from a URL, I have had a couple issues with others.

A common error is a pop-up reading "Insufficient data for an image." when opened using Adobe Reader 9.0.

Hello Kevin,

Thanks for using our products.

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFJAVA-16942. We will investigate this issue in details and will keep you updated on the status of a correction.

kpriebe:

Also, when reading from another URL (this one is more important as getting images like this to work is critical to a project I'm working on), the application just freezes (I waited for several minutes before halting execution). For this, just use the same code as above but with the URL:
http://images.realtyserver.com/photo_server.php?btnSubmit=GetPhoto&board=bismarck&name=00049911.L08

This issue is occurring because, this format for providing the image URL is currently not supported. We will investigate both the issues and will keep you updated on the status of correction.

We apologize for your inconvenience.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hello,

There is temporary workaround which works for both cases (as static url as url with GET parameters):

Pdf testpdf = new Pdf();
Section sec1 = testpdf.getSections().add();
aspose.pdf.Image image1 = new aspose.pdf.Image();
URL url = new
URL(“http://transportation.ky.gov/progmgmt/images/world.jpg”);

BufferedImage bufferinput = ImageIO.read(url);
image1.getImageInfo().setSystemImage(bufferinput);
sec1.getParagraphs().add(image1);
testpdf.save(“I:/ssp/aspose/Aspose.Pdf/16942/test16942.pdf”);


The issues you have found earlier (filed as 16942) have been fixed in this update.


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