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

Free Support Forum - aspose.com

Unable to get better quality image from xImage.save

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

Hi Gaurang,


Thanks
for using our API’s.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-34245. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.