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

Free Support Forum - aspose.com

Performance issue While Export PPT

Hi,
If the excel having more than 100 or 150 page count and if i tried to export PPT i am facing performance issue .
The below code has been used for exporting reports in PPT format.

imgOptions.setImageFormat(ImageFormat.getPng());
SheetRender sr = new SheetRender(sheet, imgOptions);
imageStream = new ByteArrayOutputStream();
byte[] imageByteArray = null;
Presentation pres = new Presentation();
ISlide sld = pres.getSlides().get_Item(0);
for(int j = 0; j < sr.getPageCount(); j++)
{
imageStream.reset();
sr.toImage(j, imageStream);
imageByteArray = imageStream.toByteArray();
/***************Create Image END *******************************************************/

/***************Create Presentation START *****************************************************/
IPPImage imgx1 = imgx1 = pres.getImages().addImage(imageByteArray);
IPictureFrame pf1=sld.getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, imgx1.getWidth(), imgx1.getHeight(), imgx1);

//Setting relative scale width and height
float imgHeightInInches = imgx1.getHeight() / 95.99f;
float imgWidthInInches = imgx1.getWidth() / 95.99f;
float heightScale = 7.5f / imgHeightInInches;
float widthScale = 10f / imgWidthInInches;
pf1.setRelativeScaleHeight(heightScale);
pf1.setRelativeScaleWidth(widthScale);
//creating new slides when multiples pages
sld = pres.getSlides().addEmptySlide(pres.getLayoutSlides().getByType(SlideLayoutType.Blank));
}

Let me know the possible solution to solve this issue.Find the attached sample PPT and excel report.

Regards,
Prabu

Hi Prabu,


Thank you for posting.

I have observed your comments and like to share with you that I am unable to reproduce the issue on my end because the attached excel file does not contain much data. I request you to please share with us the system specifications, environment details, and the sample file which is causing performance issue. Please also try using Aspose.Slides for Java 16.3.0 which is the latest available version with improved performance. I have used the code below and the attached file is created within 20 seconds. Please share the requested data and information with us so that we may proceed further to help you out.

Workbook workbook = new Workbook(String.valueOf(“D:\SampleReport.xlsx”));
// Get chart worksheet
Worksheet sheet = workbook.getWorksheets().get(“Chart”);
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setImageFormat(ImageFormat.getPng());
SheetRender sr = new SheetRender(sheet, imgOptions);
imageStream = new ByteArrayOutputStream();
byte[] imageByteArray = null;
Presentation pres = new Presentation();
ISlide sld = pres.getSlides().get_Item(0);
for(int j = 0; j < sr.getPageCount(); j++)
{
imageStream.reset();
sr.toImage(j, imageStream);
imageByteArray = imageStream.toByteArray();
/***************Create Image END *******************************************************/
/***************Create Presentation START *****************************************************/
IPPImage imgx1 = imgx1 = pres.getImages().addImage(imageByteArray);
IPictureFrame pf1=sld.getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, imgx1.getWidth(), imgx1.getHeight(), imgx1);
//Setting relative scale width and height
float imgHeightInInches = imgx1.getHeight() / 95.99f;
float imgWidthInInches = imgx1.getWidth() / 95.99f;
float heightScale = 7.5f / imgHeightInInches;
float widthScale = 10f / imgWidthInInches;
pf1.setRelativeScaleHeight(heightScale);
pf1.setRelativeScaleWidth(widthScale);
//creating new slides when multiples pages
sld = pres.getSlides().addEmptySlide(pres.getLayoutSlides().getByType(SlideLayoutType.Blank));
}
pres.save(“D:\excel_performance_16.3.0.pptx”, com.aspose.slides.SaveFormat.Pptx);

Best Regards,

Hi Adnan Ahmad,
Please find the details below,
System specifications & Environment Details :
2GB RAM , 32-Bit Operating System ,environment Unix
Jar version :
Aspose slides 16.3.0
Aspose-cells 8.7.0
Find the attached sample Excel report in which i am facing issue.

Note: Previously while using Aspose slides 15.7.0 we faced the issue for the ppt having more than 70 0r 80 slides. Now after using Aspose slides 16.3.0 it was working fine but when ppt having more than 100 or 110 slides we are facing the same performance issue.

Regards,
Prabu

Hi Prabu,


I have observed your comments and have worked with the file shared by you. I would like to share with you that 2 GB RAM may result in performance issue while creating a presentation of size 8.39 MB having 433 slides. I request you to please test it on another system with more RAM. On my side, with 4 GB of RAM, the task is completed in about 3 minutes. I have attached the generated file for your kind reference. We are working to further improve the performance of Aspose.Slides and we hope the subsequent versions to perform even better.

I hope this will clarify the concept. Please share if I may help you further in this regard.

Best Regards,