Merge POTM Files and Export to HTML in Python

Combine macro-enabled PowerPoint template files and export the merged slides as an HTML5 document with a cross-platform Python API

Merge POTM to HTML in Python

Aspose.Slides for Python via .NET lets you merge PowerPoint Macro-Enabled Template (POTM) files by cloning slides from one Presentation into another. After combining the slides with SlideCollection.add_clone, call Presentation.save with SaveFormat.HTML5 to export the merged presentation as an HTML5 document.

Merge POTM Files to HTML Using Python

Open the destination and source POTM files, append a clone of each source slide, and save the merged presentation as an HTML5 document.

Python code for merging POTM files into an HTML5 document

with slides.Presentation("destination.potm") as destination_presentation:
    with slides.Presentation("source.potm") as source_presentation:
        for slide in source_presentation.slides:
            destination_presentation.slides.add_clone(slide)

    destination_presentation.save("merged-presentation.html", slides.export.SaveFormat.HTML5)

How to Merge POTM Files and Export to HTML with Aspose.Slides for Python

Follow these steps to merge two POTM files and export the result as an HTML5 document.

  1. Install Aspose.Slides for Python via .NET by following the installation guide .

    pip install aspose-slides
    

  2. Make the aspose.slides namespace available in your Python project.

  3. Open the destination and source POTM files as Presentation instances.

  4. Iterate through the source slides and call SlideCollection.add_clone for each slide.

  5. Call Presentation.save with SaveFormat.HTML5 to write the merged presentation as an HTML5 document.