This is the real code we use to generate the Thumbnail fo each slide :
public static BufferedImage getBufferedImage2(double width, SlideEx slide) {
Dimension2D size = slide.getPresentation().getSlideSize().getSize();
double presentationScaling = size.getWidth() / size.getHeight();
double scaleX = (1f / size.getWidth()) * width;
double scaleY = ((1f / size.getHeight()) * width) / presentationScaling;
Dimension dimension = new Dimension();
dimension.setSize(scaleX,scaleY);
BufferedImage thumbnail = slide.getThumbnail(dimension);
return thumbnail;
}
Simple test
private void test()
{
PresentationEx pres = null;
try {
pres = new PresentationEx(new FileInputStream("/Test/test.pptx"));
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
SlideEx slide = pres.getSlides().get_Item(0);
Dimension2D size = slide.getPresentation().getSlideSize().getSize();
Dimension dimension = new Dimension();
dimension.setSize(1.7777,1.7777);
BufferedImage thumbnail = slide.getThumbnail(dimension);
}
This is the error :
java.lang.IllegalStateException: Cannot find resource '/Aspose/Resources/GenBasR.ttf'.
Can you please help with it ? Withe the version 2.9 was working fine .
Best regards
Angelo Trozzo.