Merge PPTX Files and Export to PDF in Python

Combine PowerPoint presentations and export the merged slides as a PDF document with a cross-platform Python API

Merge PPTX to PDF in Python

Aspose.Slides for Python via .NET lets you merge PowerPoint PPTX files by cloning slides from one presentation into another. After combining the slides with SlideCollection.add_clone, call Presentation.save with SaveFormat.PDF to export the merged slides as a single PDF document.

Merge PPTX files to PDF using Python

Open the destination and source PPTX presentations, append a clone of each source slide, and export the merged presentation as a single PDF document.

Python code for merging PPTX files into a single PDF document

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

    destination_presentation.save("merged-presentation.pdf", slides.export.SaveFormat.PDF)

How to merge PPTX files and export to PDF with Aspose.Slides for Python

Follow these steps to merge two PPTX files and export the result as a single PDF document.

  1. Install the aspose-slides package by following the Aspose.Slides for Python via .NET installation guide .

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

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

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

  5. Call Presentation.save with SaveFormat.PDF to export the merged presentation as a single PDF document.