Slides don't work for files > 5MB for PPTX

To convert office documents to images - I am using com.aspose.slides. Presentation for PPT files and com.aspose.slides.PresentationEx for PPTX files.

While conversion of PPT files above 5MB works fine but conversion of PPTX files above 5MB take more than 2 minutes and sometimes just don’t do the conversion.

We are moving our service to production and I will be a big issue if we can’t convert PPTX files above 5MB to images.

Appreciate your early help on this - I really need to get this done.


Here is the code for PPT I am using-

Presentation pres = new Presentation(strTempPath);
int pageCount = pres.getSlides().size();
coreObject.setPageCount(pageCount);
// Accessing a slide using its slide position
Slide slide = pres.getSlideByPosition(iPageNo);
// as index is starting from 1 for ppt files
// Getting the thumbnail image of the slide of a specified size
BufferedImage image = slide.getThumbnail(new Dimension(720, 540));
// Set fonts to be scanned for under the specified directory. Do
// not search within sub-folders.
FontSettings.setFontsFolder(ResourceLocator.getProperty(“FONTS”), false);
// Saving the thumbnail image in png format
output = new ByteArrayOutputStream();
ImageIO.write(image, “png”, output);


Here is the code for PPTX I am using-

PresentationEx pres = new PresentationEx(strTempPath);
int pageCount = pres.getSlides().size();
coreObject.setPageCount(pageCount);
// Accessing a slide using its slide position
SlideEx slide = pres.getSlides().get_Item(iPageNo - 1);
// as index is starting from 0 for pptx files
// Getting the thumbnail image of the slide of a specified size
BufferedImage image = slide.getThumbnail(1f, 1f);
// Set fonts to be scanned for under the specified directory. Do
// not search within sub-folders.
FontSettings.setFontsFolder(ResourceLocator.getProperty(“FONTS”), false);
// Saving the thumbnail image in png format
output = new ByteArrayOutputStream();
ImageIO.write(image, “png”, output);

Here is my business requirement.


User will send in the request to convert ONLY ONE page of PPT or PPTX to an image.
So when I am getting the request - I read the PPT or PPTX from the file path using Presentation pres = new Presentation(strTempPath); or PresentationEx pres = new PresentationEx(strTempPath); and extract the page which user requested to convert to an image using Slide slide = pres.getSlideByPosition(iPageNo); or SlideEx slide = pres.getSlides().get_Item(iPageNo - 1); and then convert that page to an image.

In com.aspose.slides.Presentation I see a method called getSlideByPosition.


Why don’t we have same method is com.aspose.slides.PresentationEx ?



Hi Zahid,

Thanks for your interest in Aspose.Slides.

I have observed the requirements shared by you and like to share that PPT is binary format and PPTX is compressed XML format. Since, PPTX is compressed so it takes more time to load as compare to PPT and it is justified owing to this reason. As far as your requirement related to availability of getSlideByPostion() method for PPTX is concerned, I like to share that you don't actually need that in case of PPTX as the slides are available in SlideExCollection in order they are available in PowerPoint. Actually in case of PPT the normal and master slides are contained in same SlideCollection and when you use pres.getSlides().getCount(), it includes both normal and master slides. So, you need to use getLastSlidePoistion() and getSlideByPosition() methods in case of PPT. In case of PPTX, you don't need to follow this as there are separate collection for normal and master slides in case PPTX.

Please share, if I may help you further in this regard. Secondly, we are working over the unification of Aspose.Slides API for PPT and PPTX. There will be single namespace for both PPT and PPTX presentations in unified API and same code base will be used. The said API will be available during Q1 of 2014.

If there is still a performance issue then please share the sample java files, sample PPT/PPTX presentations, JDK and operating system details on your end. Please also share the result achieved and we will investigate it further whether this is normal behavior or is there any performance issue.

Many Thanks,