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

Free Support Forum - aspose.com

Aspose.slides in Java having issue of performance and exception with some functionality

While working with aspose.slides to read slidecount and then iterate slides and convert to image; I faced some issues.

I am working on Mac.

1. aspose.slides is taking lots of memory with PPTX and
big PPT file; tends to throw some exceptions. (e.g. SamplePPTX.pptx and

2. For, some PPT files; I found that it is giving exact
slide number but for some other PPT; it is giving slide
count 1 extra. (
e.g. practicepowerpoint.ppt showing 20 even though slides are 19)
3. For, some PPT files, while creating image from aspose;
some text is cut; but in other it is working quite fine. (e.g.
practicepowerpoint.ppt on mac always)
4. Mainly it is too slow to create image files. (e.g. all attached)

Code for PPT
Presentation pres = new Presentation(args[0]);

Slide sl = null;
BufferedImage image = null;
String s = null;

for(int slideCount = 1; slideCount < pres.getSlides().getCount(); slideCount++)
sl = pres.getSlideByPosition(slideCount);
if(sl == null)

s = pngFolder + pngFileName + slideCount + “.png”; // here i m giving some filename

image = sl.getThumbnail(2.0f, 2.0f);
ImageIO.write(image, “PNG”, new File(s)); // write image file
sl = null;
s = null;
image = null;

catch(IOException ie)

pres = null;

For PPTx, exactly same code with PresentationEx and SlideEx; using pres.getSlides().get_Item(slideCount); and here for loop is taking from 0 not like in PPT from 1.

Hi Atil,

Thanks for inquiring Aspose.Slides.

I have observed the issues highlighted by you. First of all, I suggest you to please try using Aspose.Slides for Java 7.6.0 on your and verify the results. For the issue related to wrong slide count in terms of PPT presentations, I suggest you to please try using follow sample code for correct slide count in case of PPT.

for(int i=1;i<=pres.getSlides().getLastSlidePosition();i++)

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.

For rest of issues, I request you to please share the generated output and exception details with us. Please also specify the issues by give slide references and highlighting them in snapshot for understanding. I also request you to please log performance, rendering and exception issues in separate thread as it will be better for both of us while tracking and resolving the issues. I really appreciate your cooperation in advance for this.

Many Thanks,

Thanks Mudassir for your quick guidelines. And because of that my PPT slide count issue resolved.

Thanks again; I will start different threads for each different queries/issues.

Issues filed are:

1. Exception

2. Text

3. PPT
page count re

4. ormance

Hi Atil,

Thanks for your feedback. I have shared my response with you separately in every thread link shared by you. Please share, if I may help you further in this regard.

Many Thanks,