Merge OTP Files in Python

Combine OpenDocument Presentation Template files and save the merged slides as a single OTP template with a cross-platform Python API

Merge OTP 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.OTP to save the merged slides as a single OTP template.

Merge OTP Files Using Python

Open the destination and source OTP templates, append a clone of each source slide, and save the merged content as a single OTP file.

Python code for merging OTP files into a single template

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-template.otp", slides.export.SaveFormat.OTP)

How to Merge OTP Files with Aspose.Slides for Python

Follow these steps to merge two OTP files and save the result as a single OTP template.

  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.OTP to save the merged content as a single OTP template.