Created
July 22, 2020 15:19
-
-
Save aspose-com-gists/32bd89909f83834c357a6024cc2fc7f8 to your computer and use it in GitHub Desktop.
Convert PDF to PPTX using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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