# Merge PDF Files in Python

> Merge PDF files in Python by importing their pages as slides and exporting the combined content as a PDF document.

Source: https://products.aspose.com/slides/python-net/merge/pdf/
Updated: 2026-07-28



## Merge PDF in Python

[*Aspose.Slides for Python via .NET*](/slides/python-net/) lets you combine PDF files by importing their pages into a `Presentation`. `SlideCollection.add_from_pdf` converts each PDF page into a slide and appends it to the presentation.

After all source files are imported, call `Presentation.save` with `SaveFormat.PDF` to export the slides as one PDF document. Microsoft PowerPoint and Adobe Acrobat are not required.

## Merge PDF files using Python

Create a presentation without its default blank slide, import the source PDF files in the required order, and export the combined slides as one PDF document.

### Python code for merging PDF files

```python
with slides.Presentation() as presentation:
    presentation.slides.remove_at(0)
    presentation.slides.add_from_pdf("document1.pdf")
    presentation.slides.add_from_pdf("document2.pdf")

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

## How to merge PDF using Aspose.Slides for Python API

These are the steps to merge PDF files in Python.

Install [*Aspose.Slides for Python via .NET*](/slides/python-net/).

Create an empty `Presentation`.

Remove the default blank slide from the presentation.

Pass each source PDF file to `SlideCollection.add_from_pdf` in the required order.

Call `Presentation.save` with the output file path and `SaveFormat.PDF`.

## Export PDF to Other Supported Formats
