Merge PPTM Files into a POT File in Python

Use Aspose.Slides for Python via .NET to combine PPTM presentations and save the merged slides as a POT file without Microsoft PowerPoint.

Merge PPTM to POT in Python

Aspose.Slides for Python via .NET lets you combine PPTM presentations by cloning slides from a source presentation into a destination presentation. The SlideCollection.add_clone method copies each slide and its associated layout and master data as needed, preserving the source slide’s appearance. After adding the slides, use Presentation.save with SaveFormat.POT to create a single POT file.

Merge PPTM files to POT using Python

Open the destination and source PPTM files, clone each source slide into the destination presentation, and then save the result in POT format.

Python code to merge multiple PPTM files into one POT file

with slides.Presentation("presentation1.pptm") as destination_presentation:
    with slides.Presentation("presentation2.pptm") as source_presentation:
        for source_slide in source_presentation.slides:
            destination_presentation.slides.add_clone(source_slide)

    destination_presentation.save("merged.pot", slides.export.SaveFormat.POT)

How to merge PPTM to POT using Aspose.Slides for Python API

Follow these steps to merge two PPTM files and save the result as a POT file in Python.

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

  2. Import the aspose.slides package and assign it the slides alias in your Python source file.

  3. Open one PPTM file as the destination Presentation and the other as the source Presentation.

  4. Iterate through the source slides and add each slide to the destination by calling SlideCollection.add_clone .

  5. Call Presentation.save with the output file name and SaveFormat.POT to create the merged POT file.