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

Free Support Forum - aspose.com

Issue while splitting PPT to images

Hi,


While we try to split pages of attached ppt to individual images, after few pages, we are facing out of memory error. Please help.


Regards,
Sushma.

Hi Sushma,


I have worked with presentation file shared by you using Aspose.Slides for Java 17.4 and unable to observe the issue. I have also shared my generated result with you for your kind reference. Can you please share sample code, environment details and also please share which Aspose.Slides version you are using on your end. Please share the requested information so that we can further investigate to help you out.

Best Regards,
Hi Adnan,

Below is the code I have used.

import java.io.File;
import java.io.InputStream;

import com.aspose.slides.ILayoutSlide;
import com.aspose.slides.ISlide;
import com.aspose.slides.License;
import com.aspose.slides.LoadFormat;
import com.aspose.slides.LoadOptions;
import com.aspose.slides.Presentation;

public class PPTSplitIntoImages {
public static void main( String[] args )
{
//creating an empty presentation
try {
InputStream fileInputStream = new java.io.FileInputStream("D://TEST.pptx");
License license = new License();
license.setLicense(new java.io.FileInputStream("D://Aspose.Slides.lic"));
LoadOptions l = new LoadOptions();

l.setLoadFormat( LoadFormat.Auto);
Presentation pres = new Presentation (fileInputStream,l);
int pptPageCount = pres.getSlides().size();
for(int i = 0; i < pptPageCount; i++)
{
//Access the first slide
ISlide sld = pres.getSlides().get_Item(i);
InputStream is = null;
try
{
File f = new File("D://SplitImages//"+i+".pptx");
Presentation p = new Presentation();
p.getSlides().removeAt( 0);
ILayoutSlide layout = p.getLayoutSlides().addClone(sld.getLayoutSlide());
ISlide destSlide = p.getSlides().insertClone(0, sld, layout );
p.getSlides().addClone(destSlide);
p.save(f.getAbsolutePath(), 3);
System.out.println("Writing Image of Slide no "+ i + "to DB ");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}catch (Exception e) {
e.printStackTrace();
}
}
}

Hi Sushma,

Thanks for sharing the sample code. In your sample code you are actually splitting slides and saving to individual presentations rather than splitting to images. I have used Aspose.Slides for Java 17.4 on my end and have not been able to observe the issue. For your kind reference the generated output presentations are also attached. I suggest you to please try increasing Java heap size on your end if you are getting OutOfMemory exception. You can please visit this web link for more information on increasing Java heap size.

Many Thanks,

Hi Mudassir,


Thanks for your note.

I tried again and with the current heap space which was causing issue, while converting entire ppt slide by slide.

Instead I tired to create one ppt for single slide and convert it into image which worked fine. But had alignment issues.(PPTSplitIntoPPT.txt)

Attached is code for both the cases, along with sample PPT. (PPTSplitIntoPng.txt)

Source PPT - Covert_to_Images.pptx (modified from previous version)

Hi Sushma,

I have worked with presentation file shared by you using Aspose.Slides for Java 17.4 and have been able to observe the issue. A ticket with ID SLIDESJAVA-36395 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

We are sorry for your inconvenience,

Hi,


Is there any ETA for this issue??

Hi Sushma,


I have observed your comments. I regret to inform that issue is still unresolved. This issue has been scheduled for investigation in current week. I have also requested our product team to share further feedback regarding this issue. I request for your patience until further feedback is shared by our team and issue gets resolved.

We are sorry for your inconvenience,

Hi Adnan,


Any further update on the below issue. It is a stopper for our work. Can you please consider on high priority.

Hi Sushma,

I have observed the issue status in our issue tracking system and like to share that issue has just recently been created and is unresolved. The issue has been added as per normal priority which is default priority level for normal forum support query. I request for your patience till the time the issue gets resolved or you may please consider opting for paid support to expedite the issue resolution. Please visit this page link for available support services.

Many Thanks,