Merge PPTX Files into POTM in Python

Combine PowerPoint presentations and save the result as a POTM file with a fast, cross-platform Python API. Microsoft PowerPoint is not required.

Merge PPTX to POTM in Python

Aspose.Slides for Python via .NET is a Python library for creating, editing, and converting presentation files. To merge PPTX presentations, clone each slide from a source Presentation into a destination presentation by calling add_clone on its slides collection. Cloned slides retain their shapes, styles, text, formatting, comments, and animations. The combined presentation can then be saved as a POTM file.

Merge PPTX files to POTM using Python

Clone each slide from the source presentation into the destination presentation, then save the combined presentation in POTM format.

Python code to merge multiple PPTX files into one POTM file

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.potm", slides.export.SaveFormat.POTM)

How to merge PPTX to POTM using Aspose.Slides for Python API

Follow these steps to merge two PPTX files and save the result as POTM in Python.

  1. Install Aspose.Slides for Python via .NET with pip install aspose-slides.

  2. Load the first PPTX file into the destination Presentation, and load the second PPTX file into the source Presentation.

  3. Iterate through the source presentation’s slides collection.

  4. Clone each source Slide into the destination presentation by calling add_clone .

  5. Call Presentation.save with SaveFormat.POTM to write the merged presentation to a POTM file.