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

Free Support Forum - aspose.com

PDF to PNG conversion is not done properly

Hi,


I have tried to generate PNG from the PDF file but there are black marks allover and there is color shading in the bottom left corner.

I have attached the input pdf (D0725815_G03_CH06_L02_Mat_Explore.pdf) and
output png (OutPutD0725815_G03_CH06_L02_Mat_Explore_0.png) in this ticket. Please resolve this issue.

Hi Upendra,


Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Pdf for Java 10.9.0 and unable to notice the reported issue. Please download and try latest release of Aspose.Pdf for Java, it will resolve the issue.

//Open document<o:p></o:p>

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

pngDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);

// Close the stream

imageStream.close();

}


Please feel free to contact us for any further assistance.

Best Regards,

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.


I have some doubts regarding this

1. Which version of java have you used while u have executed the above code?
2. What is the OS and version you used to test the above testing case.
3. What Microsoft office version is installed in your system and Do installed Microsoft office version on the machine has anything to do with the execution of jar and the available fonts for the Jar.


Thanks

Hi Upendra,


Thanks for your feedback. I have tested the scenario over Win7 64 bit with Eclipse using JDK 1.7.0_71 and Aspose.Pdf for Java 10.9.0. Furthermore, Aspose.Pdf does not need any third party tool for processing e.g. MS Office or Adobe Acrobat. Please share your environment details so we will investigate it further.

We are sorry for the inconvenience caused.

Best Regards,

Hi ,


I faced this issue on both Mac OS version 10.11.1 64 bit && Windows 7 64 bit
The java version in both Machines is JDK “1.8.0_25”.
Aspose pdf jar version is 10.9.0

Hi Upendra,



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.