I’m using latest version of aspose.pdf
([Aspose.Pdf for Java 9.0.0]))
when i’m trying to convert png i’m unable to do it
& the coverted jpeg files are very poor
i have used the above link as reference
i have attached the sample files
I’m using latest version of aspose.pdf
([Aspose.Pdf for Java 9.0.0]))
when i’m trying to convert png i’m unable to do it
& the coverted jpeg files are very poor
i have used the above link as reference
i have attached the sample files
Hi Bharathkumar,
//open
document<o:p></o:p>
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("c:/pdftest/AISB08.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("c:/pdftest/AISB08_Converted_Image" + pageCount + ".jpg");
//create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
//create JpegDevice object where second argument indicates the quality of resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
//convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
//close the stream
imageStream.close();
}