Merge OTP Files and Save as HTML in Python

Combine OpenDocument Presentation Template files and export the merged presentation as HTML5 with a cross-platform Python API

Merge OTP to HTML in Python

Aspose.Slides for Python via .NET lets you merge OpenDocument Presentation Template (OTP) files by cloning slides from one template into another. After combining the slides with SlideCollection.add_clone, call Presentation.save with SaveFormat.HTML5 to export the merged presentation as a single HTML5 document.

Merge OTP Files to HTML Using Python

Open the destination and source OTP templates, append a clone of each source slide, and export the merged presentation as a single HTML5 document.

Python code for merging OTP files into a single HTML5 document

with slides.Presentation("destination.otp") as destination_presentation:
    with slides.Presentation("source.otp") 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 OTP Files and Save as HTML with Aspose.Slides for Python

Follow these steps to merge two OTP files and export the result as a single 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 OTP 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 export the merged presentation as a single HTML file.