Merge ODP Files in Python

Combine OpenDocument Presentation files with a cross-platform Python API

Merge ODP in Python

Aspose.Slides for Python via .NET lets you merge OpenDocument Presentation (ODP) files by cloning slides from a source presentation into a destination presentation. SlideCollection.add_clone appends a copy of each source slide, including its content and associated formatting. You can then save the combined presentation with SaveFormat.ODP.

Merge ODP Files Using Python

Open the destination and source ODP presentations, iterate through the source slides, and append a clone of each slide to the destination presentation.

Python code for merging multiple ODP files into one presentation

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

    destination_presentation.save("merged-presentation.odp", slides.export.SaveFormat.ODP)

How to Merge ODP Files with Aspose.Slides for Python

Follow these steps to merge two ODP files and save the result as a single ODP presentation.

  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 ODP files as Presentation instances.

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

  5. Call Presentation.save with SaveFormat.ODP to write the merged presentation.