Skip to content

Instantly share code, notes, and snippets.

How to Merge PowerPoint Files using Python. For more details: https://kb.aspose.com/slides/python/how-to-merge-powerpoint-files-using-python/
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