public static void main(String[] args) {
Presentation pres = new Presentation(“aaa.pdf”);
try {
// Render presentation to images array slide by slide
for (int i = 0 ; i < pres.getSlides().size(); i++)
{
// Control hidden slides (do not render hidden slides)
if (pres.getSlides().get_Item(i).getHidden())
continue;
BufferedImage bmp = pres.getSlides().get_Item(i).getThumbnail(2f, 2f);
// Create file name for an image
String outputFilePath = “aaa.jpg”;
final Instant now = Instant.now();
File file = new File(outputFilePath);
ImageIO.write(bmp, "jpg",file);
}
} catch (Exception e) {
log.warn(e+"");
throw new RuntimeException(e);
}
}
@zyx,
Thank you for the query. Unfortunately, Aspose.Slides still cannot load PDF files. I checked the image quality using conversion the same way for a presentation (PPTX -> Bitmap -> JPG) and found it perfect.
If you found an issue, please share and specify the following:
Maybe you have misunderstood what I mean. I think aspose has done a good job, but now I want to reduce the quality of the jpg images produced to reduce the size of the generated images, so is there any better way?