Saving a PowerPoint Presentation File in Java Takes Over 50 Seconds

Hi Team,

I am trying to read the presentation file. And at run time, I am setting the title of ppt document using getDocumentProperties. But, it is taking time to execute the save method. Please find the code snippet
Note: Make sure that ppt file is big in size. It should be more than 5 mb.
We are using aspose.slides version 23.5-jdk16.jar

File pptFile = new File("pptFilePath");
try (FileInputStream fileInputStream = new FileInputStream(pptFile)) {
			logger.info("initilizatize fileInputStream for the ppt document");
			Presentation ppt = new Presentation(fileInputStream);
			logger.info("initilizatize presensentation object");
			ppt.getDocumentProperties().setTitle("SampleTitle");
			ppt.save(outputPdfFilePath,SaveFormat.Pdf,pdfOptions); //This ppt.save method takes more 60 seconds to execute.
}
catch (Exception e) {
//
}

Could you please help us to optimize execution while saving the ppt file.

@forasposeissues,
Thank you for contacting support.

To investigate the case, we need more details. Please share the following files and information:

  • sample presentation file
  • OS version on which the code was executed
  • JDK version in your app

Hi Team,

Please find the details given below as mention in above thread.
OS Version: os.name=Linux|os.arch=amd64|os.version=3.10.0-1160.102.1.el7.x86_64
JDK Version : JDK17
For Presentation file. You can download from web which has more than 5 mb size. We cannot share the ppt file.

@forasposeissues,
Thank you for the additional information. We also need a sample presentation from you. You can zip the presentation file and upload an archive here.

sample_ppt_file.zip (2.9 MB)

@forasposeissues,
Thank you for the sample presentation. Please note that the code example you provided contains an unknown variable pdfOptions. Could you please share the complete code example?

try to declare the variable as global given below

@Setter
PdfOptions pdfOptions;

@forasposeissues,
Thank you for the details. I’ve reproduced the performance problem when converting the presentation to PDF.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39379

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@forasposeissues,
We have investigated the case. Yes, saving the presentation without a license takes about 50 seconds, but converting that presentation to a PDF with a license takes about 22 seconds. Unfortunately, we did not find any bottlenecks in our code related to converting the presentation to PDF. There are many images used in the presentation. For this reason, the execution time (about 20 seconds) is quite reasonable. We apologize for any inconvenience.