I have tried a few combinations of the code to convert the PPTX file to PDF but the only result I am getting is what I have attached as the ss below image.jpg (154.2 KB)
Presentation presentation = new Presentation(sourcePath);
presentation.getPresentation().save(targetPath, SaveFormat.PDF);
Presentation presentation = new Presentation(sourcePath);
presentation.save(targetPath, SaveFormat.PDF);
Presentation presentation = new Presentation(sourcePath);
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setSaveMetafilesAsPng(true);
pdfOptions.setTextCompression(PdfTextCompression.Flate);
pdfOptions.setCompliance(PdfCompliance.Pdf15);
presentation.save(targetPath, SaveFormat.PDF, pdfOptions);
presentation.dispose();
I opened the PDF file using Adobe Acrobat Reader and no error messages appeared. We need more details to investigate the case. Please share the following files and information:
original presentation file (you can compress the file and upload a ZIP file here)
OS version on which the conversion was performed
JDK target version in your app project
name and version od the application that shows the error message
@andrey.potapov if you remove the.pdf from the end of the pdf file attached above you get the pptx file but I have also provided the info you asked for
@rn.air,
Thank you for the additional information. It looks like you are using the SaveFormat class from another Java package because it should be used as SaveFormat.Pdf instead of SaveFormat.PDF. Please check this carefully. SaveFormat | Aspose.Slides for Java API Reference