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

Free Support Forum - aspose.com

Unable to extract images from PDF

hi, for a pdf the aspose pdf library (version 4.2.1) is unable to extract the images. As attachments, I have shared the error that we are getting along with screenshot of properties of that pdf.

this is a critical incident for us, hence needs your highest attention on this.


Hi Sonu,

Thanks for your inquiry. You are using a quite old version of Aspose.Pdf for Java. Please download and try latest version of Aspose.Pdf for Java, hopefully it will resolve the issue. If issue persist then please share your sample source PDF document here, we will investigate the issue at our end and will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi, error attached with latest version 9.5.2 for jdk1.6 for same PDF.

Hi Sonu,

Thanks for sharing the feedback.

I have tested the scenario using Aspose.Pdf for Java 9.5.2 in Eclipse Juno application running over Windows 7 (x64) with JDK 1.7 and I am unable to notice any problem. The Images are properly being extracted from PDF file. For your reference, I have also attached the images extracted over my end.

Can you please share some details regarding your working environment i.e. Operating System, JDK version etc.

We are really sorry for your inconvenience.


a document

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("c:/pdftest/Properties.pdf");

for (int counter = 1; counter <= pdfDocument.getPages().size(); counter++)


//Extract a particular image

com.aspose.pdf.XImage xImage = pdfDocument.getPages().get_Item(counter).getResources().getImages().get_Item(1);

//Create stream object to save the output image

java.io.OutputStream output = new java.io.FileOutputStream("c:/pdftest/Properties_output" + counter + ".jpg");

//Save the output image




hi, problem is not with properties.pdf that I have attached earlier. that just contains the property screenshots of the PDF that we are testing against.

Hi Sonu,

As requested earlier, please share the resource PDF causing this problem so that we can test the scenario at our end.