Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created July 22, 2020 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/32bd89909f83834c357a6024cc2fc7f8 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/32bd89909f83834c357a6024cc2fc7f8 to your computer and use it in GitHub Desktop.
Convert PDF to PPTX using Java
// Load PDF document
Document pdfDocument = new Document("document.pdf");
// Set PPTX save options
PptxSaveOptions pptxOptions = new PptxSaveOptions();
pptxOptions.setSlidesAsImages(true);
// Save PDF as PPTX
pdfDocument.save("PDF to PPT.pptx", pptxOptions);
PptxSaveOptions pptxOptions = new PptxSaveOptions();
pptxOptions.setCustomProgressHandler(new UnifiedSaveOptions.ConversionProgressEventHandler() {
@Override
public void invoke(UnifiedSaveOptions.ProgressEventHandlerInfo eventInfo) {
// Example of how to handle progress events:
System.out.println(ProgressEventType.getName(ProgressEventType.class, eventInfo.EventType) + "\t"
+ eventInfo.Value + " from: \t" + eventInfo.MaxValue);
}
});
// Load PDF
Document pdfDocument = new Document("document.pdf");
// Save PDF as PPTX
pdfDocument.save("PDF to PPTX.pptx", pptxOptions);
// Load PDF document
Document pdfDocument = new Document("document.pdf");
PptxSaveOptions pptxOptions = new PptxSaveOptions();
// Convert PDF to PPTX
pdfDocument.save("PDF to PPT.pptx", pptxOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment