Learn how to split slides in PowerPoint PPT or PPTX using Python: https://blog.aspose.com/2021/12/23/split-ppt-slides-in-python/
Last active
January 4, 2022 13:22
-
-
Save aspose-com-gists/ede3f01641aca14a3dbda2812f54e67e to your computer and use it in GitHub Desktop.
Split Slides in PowerPoint PPT/PPTX in Python
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
import aspose.slides as slides | |
# Load presentation | |
ppt = slides.Presentation("presentation.pptx") | |
# Loop through slides | |
for index in range(ppt.slides.length): | |
# Create a new empty presentation | |
with slides.Presentation() as newPpt: | |
# Remove default slide | |
newPpt.slides[0].remove() | |
# Add slide to presentation | |
newPpt.slides.add_clone(ppt.slides[index]) | |
# Save presentation | |
newPpt.save("slide_{i}.pptx".format(i = index), slides.export.SaveFormat.PPTX) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment