Learn how to split PowerPoint presentations using Java: https://blog.aspose.com/2021/08/10/split-powerpoint-presentations-using-java/
Last active
September 9, 2021 05:44
-
-
Save aspose-com-gists/45a4f75a2eec6324a9da6541a6f70bf0 to your computer and use it in GitHub Desktop.
Split PowerPoint Presentations 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 PowerPoint presentation | |
Presentation presentation = new Presentation("presentation.pptx"); | |
// Iterate through the slides in the presentation | |
for (ISlide sld : presentation.getSlides()) { | |
// Create a new presentation | |
Presentation newPres = new Presentation(); | |
// Remove default slide | |
newPres.getSlides().get_Item(0).remove(); | |
// Add slide to presentation | |
newPres.getSlides().addClone(sld); | |
// Save presentation | |
newPres.save(String.format("Slide_{0}.pptx", sld.getSlideNumber()), SaveFormat.Pptx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment