Merge PPTX Files in Python
Build cross-platform Python applications that merge, inspect, create, and convert Microsoft PowerPoint and OpenDocument presentations without installing Microsoft PowerPoint or OpenOffice.
Merge PPTX in Python
Aspose.Slides for Python via .NET is a presentation-processing library that can combine multiple PPTX files. To merge presentations, clone each slide from a source presentation into a destination presentation. The cloned slides retain their content, layouts, formatting, shapes, comments, and animations.
Merge PPTX files using Python
Open the destination and source presentations, clone each source slide into the destination presentation, and save the merged result as a PPTX file.
Python code to merge multiple PPTX files into one presentation
with slides.Presentation("presentation1.pptx") as destination_presentation:
with slides.Presentation("presentation2.pptx") as source_presentation:
for slide in source_presentation.slides:
destination_presentation.slides.add_clone(slide)
destination_presentation.save("merged.pptx", slides.export.SaveFormat.PPTX)
How to merge PPTX using Aspose.Slides for Python API
Follow these steps to merge two PPTX files into one presentation in Python.
Install Aspose.Slides for Python via .NET from PyPI.
Import the
aspose.slidespackage into your Python project.Load the destination and source PPTX files with the
Presentationclass.Iterate through the source slides and append each one to the destination by calling
add_clone.Call
savewithSaveFormat.PPTXto write the merged presentation to one PPTX file.
Export PPTX to Other Supported Formats
You can also combine PPTX presentations and export the result to other supported formats.