Is there any parameter that can be used to set/enhance the quality of the image file created from the PPT. Basically i need to generate a Thumbnail of the first slide. so i am using Aspose Slides to convert the first slide of a ppt to a thumbnail image(jpeg of size 80x80). The quality of the thumbnail image generated is not very impressive. Is there a way to enhance the quality by setting some parameter on com.aspose.slides.Slide class. My current code snippet is as follows.
publicboolean convert(String pptFileName){
Presentation pres;
try {
//Instantiate a Presentation object that represents a PPT file
pres = new Presentation(new FileInputStream(new File(pptFileName)));
// Accessing a slide using its slide position
Slide slide = pres.getSlideByPosition(1);
// Getting the thumbnail image of the slide of a specified size
We regret to inform you that there is no such parameter defined in Aspose.Slides that ensures the quality of thumbnail. However, you can set the different scaling levels of resolution in it.
Please use the code snippet below to generate the thumbnail image at different scaling levels. In slide.getThmbnail() method, you provide the scaling factor in arguments section. whatever value, you will provide, the thumbnail generated will conform that.
try
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation(new FileInputStream(new File("demo.ppt")));
//Accessing a slide using its slide position
Slide slide = pres.getSlideByPosition(1);
//Getting the thumbnail image of the slide of a specified size
// Setting parameter to 1f sets the thumbnail to size of slides, if it is 2f then the
// thumbnail generated is twice the size of slide
BufferedImage image=slide.getThumbnail(1f,1f );
//Saving the thumbnail image in jpeg format
ImageIO.write(image,"jpeg", new File("C:\\thumbnail.jpg"));
}
catch (Exception ex)
{
System.out .println(ex.toString());
}