Hi,
I am trying to save the image from the attached pdf file using 20 and 600 as resolution as in the following code, but I am getting the same quality image. Kindly guide me to extract a good quality image of the chart from the PDF.
try {
// Extract a particular image
pdfDocument = new com.aspose.pdf.Document(pdfFilePath);
com.aspose.pdf.XImage xImage = pdfDocument.getPages().get_Item(1).getResources().getImages().get_Item(1);
final String outputFile = ChartServiceUtil.getFilePath(pdfFilePath) + fileName +"."+ format;
// Create stream object to save the output image
System.out.println("Saving image....");
output = new java.io.FileOutputStream(outputFile);
System.out.println("Saved image :"+outputFile);
// Save the output image
xImage.save(output, 600);
retVal = outputFile;
} catch (Exception e) {
logger.error( e.getMessage(),e);
}
Thanks,
Gaurang