Aspose.Slides for Java 23.5 Is Giving Error while Converting from PPT to PDF

Hi Team,

We are using aspose pdf version

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-pdf</artifactId>
    <version>23.5</version>
    <classifier>jdk17</classifier>
</dependency>
and slides version

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>23.5</version>
    <classifier>jdk16</classifier>
</dependency>

While converting from ppt to pdf on our ECS server which has jdk 17 and we are getting this error

at com.aspose.slides.vzr.q5(Unknown Source)

45381at com.aspose.slides.pq1.q5(Unknown Source)

45382at com.aspose.slides.pq1.<init>(Unknown Source)

45383at com.aspose.slides.csh.q5(Unknown Source)

45384at com.aspose.slides.xmv.q5(Unknown Source)

45385at com.aspose.slides.xmv.q5(Unknown Source)

45386at com.aspose.slides.xmv.q5(Unknown Source)

45387at com.aspose.slides.hq.q5(Unknown Source)

45388at com.aspose.slides.j9b.q5(Unknown Source)

45389at com.aspose.slides.vb.sl(Unknown Source)

45390at com.aspose.slides.vb.q5(Unknown Source)

45391at com.aspose.slides.kb5.sl(Unknown Source)

45392at com.aspose.slides.kb5.q5(Unknown Source)

45393at com.aspose.slides.kb5.q5(Unknown Source)

45394at com.aspose.slides.kb5.q5(Unknown Source)

45395at com.aspose.slides.Slide.q5(Unknown Source)

45396at com.aspose.slides.cid.q5(Unknown Source)

45397at com.aspose.slides.cid.q5(Unknown Source)

45398at com.aspose.slides.Presentation.q5(Unknown Source)

45399at com.aspose.slides.Presentation.save(Unknown Source)

45400at com.citi.rendition.converters.aspose.ppt.filetypeconverters.RenditionPPTToPDFConverterWithPDFOptions.convert(RenditionPPTToPDFConverterWithPDFOptions.java:40)

45401at com.citi.research.distribution.tasks.create.CreatePPTPDFRendition.createPPTPDFRendition(CreatePPTPDFRendition.java:210)

45402at com.citi.research.distribution.tasks.create.CreatePPTPDFRendition.execute(CreatePPTPDFRendition.java:149)

45403at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:389)

45404at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:313)

45405at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)

45406at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:256)

45407at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)

45408at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:362)

45409at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:206)

45410at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:139)

45411at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:241)

45412at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:227)

45413at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:153)

45414at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68)

45415at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68)

45416at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:167)

45417at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:142)

45418at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:137)

**45419at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:316)**

**45420at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:157)**

**45421at java.base/java.lang.Thread.run(Thread.java:833)**

**45422Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /opt/jdk/17.0_8l64/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory [in thread "SimpleAsyncTaskExecutor-12"]**

45423at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)

45424at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)

 like 1

Please help to check this issue.

@forasposeissues,
Thank you for contacting support.

Please share the following additional files and information:

  • sample presentation file
  • code example that reproduces the error
  • OS version on which the error occured

We have jdk 17.0_8l64 on our server.
Sample code which we are using -

String rightsWatchMark = (String) ppt.getDocumentProperties().get_Item("RightsWATCHMark");
String encodedRightsWatchMark = Base64.getEncoder().encodeToString(rightsWatchMark.getBytes());
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(outputPdfFilePath);
DocumentInfo documentProperty = pdfDocument.getInfo();
documentProperty.set_Item("RightsWATCHMark", encodedRightsWatchMark);
pdfDocument.save();

You can try with any PPT file. It is failing every time.

@forasposeissues,
Thank you for the additional information. You can see that the error occurs inside the Presentation.save method:

but your code example does not call the Presentation.save method.

Please check the issue carefully.

Yes, my bad. We are using

Presentation ppt = new Presentation(fileInputStream);
ppt.save(outputPdfFilePath,SaveFormat.Pdf,pdfOptions);

@forasposeissues,
Thank you for the code example. I am guessing that you are using the Aspose.Pdf.SaveFormat enum instead of Aspose.Slides.Export.SaveFormat when saving PowerPoint presentations. Please check this.

Checked code. We are using SaveFormat from Aspose slides.

@forasposeissues,
This is very simple code that usually works fine. We need more details to reproduce the issue you are experiencing.