Last active
May 19, 2023 18:19
How to Merge PowerPoint Files using Python. For more details: https://kb.aspose.com/slides/python/how-to-merge-powerpoint-files-using-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 the license | |
lic = slides.License() | |
lic.set_license("Aspose.Total.lic") | |
# Load the destination presentation | |
MainPres = slides.Presentation("Main.pptx") | |
# Load the presentations whose slides are to be cloned | |
SubPres1 = slides.Presentation("SubPres1.pptx") | |
SubPres2 = slides.Presentation("SubPres2.pptx") | |
# Iterate through all slides | |
for slide in SubPres1.slides: | |
# Clone each slide | |
MainPres.slides.add_clone(slide) | |
# Iterate through all slides | |
for slide in SubPres1.slides: | |
# Clone each slide | |
MainPres.slides.add_clone(slide) | |
MainPres.save("result.pptx", slides.export.SaveFormat.PPTX) | |
print("Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment