# Convert PDF to EMF in Python

> Convert PDF pages to EMF files in Python. Use the Aspose.Slides Python API to import a PDF and export each page as an Enhanced Metafile.

Source: https://products.aspose.com/slides/python-net/conversion/pdf-to-emf/
Updated: 2026-08-11



## Convert PDF to EMF in Python

[*Aspose.Slides for Python via .NET*](/slides/python-net/) lets you convert PDF pages to EMF files programmatically. Import the PDF pages into a `Presentation` by using `SlideCollection.add_from_pdf`, then export each imported slide by using `Slide.write_as_emf`.

This workflow creates one EMF file for each page in the source PDF. You can test the conversion in your [browser](https://products.aspose.app/pdf/conversion/pdf-to-emf) or use the Python API in your application.

Install the library from [PyPI](https://pypi.org/project/aspose-slides/) by using the following command:

### Console/Terminal

```console
pip install aspose-slides
```

## How to Convert PDF to EMF in Python

Follow these steps to convert a PDF file to EMF using Python.

Create a `Presentation`, remove its default slide, and import the PDF by using `SlideCollection.add_from_pdf`.

Iterate through `Presentation.slides` and open a binary output stream for each imported page.

Write each slide to its output stream by using `Slide.write_as_emf`.

## System Requirements

Before running the Python conversion sample, make sure your environment meets these requirements.

- Microsoft Windows, macOS, or 64-bit Linux (see the [system requirements](https://docs.aspose.com/slides/python-net/system-requirements/)).
- Python 3.6 or later for this sample.
- Aspose.Slides for Python via .NET installed in your environment.

### This sample code shows how to convert PDF to EMF in Python

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

    for slide in presentation.slides:
        file_path = f"document_page_{slide.slide_number}.emf"
        with open(file_path, "wb") as output_stream:
            slide.write_as_emf(output_stream)
```

## Save PDF as EMF in Python

Use the [free online app](https://products.aspose.app/pdf/conversion/pdf-to-emf) to see the PDF-to-EMF conversion process in action.

## Other Supported Conversions

- [PDF TO BMP](/slides/python-net/conversion/pdf-to-bmp/) — Bitmap Image
- [PDF TO FODP](/slides/python-net/conversion/pdf-to-fodp/) — OpenDocument Flat XML Presentation
- [PDF TO GIF](/slides/python-net/conversion/pdf-to-gif/) — Graphics Interchange Format
- [PDF TO HTML](/slides/python-net/conversion/pdf-to-html/) — Hypertext Markup Language
- [PDF TO JPG](/slides/python-net/conversion/pdf-to-jpg/) — JPEG Image
- [PDF TO ODP](/slides/python-net/conversion/pdf-to-odp/) — OpenDocument Presentation Format
- [PDF TO OTP](/slides/python-net/conversion/pdf-to-otp/) — OpenDocument Presentation Template
- [PDF TO PNG](/slides/python-net/conversion/pdf-to-png/) — Portable Network Graphics
- [PDF TO POT](/slides/python-net/conversion/pdf-to-pot/) — PowerPoint 97–2003 Template
- [PDF TO POTM](/slides/python-net/conversion/pdf-to-potm/) — PowerPoint Macro-Enabled Template
- [PDF TO POTX](/slides/python-net/conversion/pdf-to-potx/) — PowerPoint Template
- [PDF TO PPS](/slides/python-net/conversion/pdf-to-pps/) — PowerPoint Slide Show
- [PDF TO PPSM](/slides/python-net/conversion/pdf-to-ppsm/) — Macro-enabled Slide Show
- [PDF TO PPSX](/slides/python-net/conversion/pdf-to-ppsx/) — PowerPoint Slide Show
- [PDF TO PPT](/slides/python-net/conversion/pdf-to-ppt/) — PowerPoint 97-2003 Presentation
- [PDF TO PPTM](/slides/python-net/conversion/pdf-to-pptm/) — Macro-enabled Presentation File
- [PDF TO PPTX](/slides/python-net/conversion/pdf-to-pptx/) — Open XML Presentation Format
- [PDF TO SVG](/slides/python-net/conversion/pdf-to-svg/) — Scalable Vector Graphics
- [PDF TO SWF](/slides/python-net/conversion/pdf-to-swf/) — Small Web Format
- [PDF TO TIFF](/slides/python-net/conversion/pdf-to-tiff/) — Tagged Image File Format
- [PDF TO XPS](/slides/python-net/conversion/pdf-to-xps/) — XML Paper Specification
