com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(myDir+"D0725815_G03_CH06_L02_Mat_Explore.pdf");
//Loop through all the pages of PDF file
for (int pageCount = 1; pageCount <= pdfDocument.getPages().size(); pageCount++)
// Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream(myDir+"Converted_Image" + pageCount + ".png");
// Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
// Create PngDevice object with particular resolution
com.aspose.pdf.devices.PngDevice pngDevice = new com.aspose.pdf.devices.PngDevice(resolution);
// Convert a particular page and save the image to stream
// Close the stream
Thanks for getting back on this issue. I have used the latest jar 10.9.0 to generate this png from pdf . I used the same code u mentioned but still i am getting similar distorted output as mentioned in the above ticket.
Thanks for sharing the details.
I have tested the scenario using Aspose.Pdf for Java 10.9.0 on MAC OS X 10.10 (Yosemite) with JDK 1.8.0_60 and I am unable to notice any issue. As per my observations, the PDF file is properly being converted to PNG format. For your reference, I have also attached the output image generated over my end. Please take a look.