---
title: "Converting PDF pages to images | Nutrient Python SDK"
canonical_url: "https://www.nutrient.io/guides/python/conversion/pdf-pages-to-images/"
md_url: "https://www.nutrient.io/guides/python/conversion/pdf-pages-to-images.md"
last_updated: "2026-06-09T19:34:32.777Z"
description: "Export each page of a PDF as a separate image file using Nutrient Python SDK."
---

# Converting PDF pages to images

Convert each page in a multi-page PDF into a separate image file. Use this approach when you need per-page previews, thumbnails, or image-based processing for individual pages.

[Download sample](https://www.nutrient.io/downloads/samples/python/pdf-pages-to-images.zip)

## How Nutrient supports this workflow

Here’s how the Nutrient Python SDK handles image export for multi-page PDFs.

When you export a multi-page PDF as PNG, JPEG, or BMP, the SDK writes one numbered file for each page. The destination filename acts as a template. For example, `output.png` becomes `output-1.png`, `output-2.png`, and so on.

For TIFF output, the SDK writes all pages to a single multi-page file. If you need single-file TIFF output, refer to the [PDF to image](https://www.nutrient.io/guides/python/conversion/pdf-to-image.md) guide.

You don’t need to:

- Iterate through pages yourself

- Create per-page filenames

- Render each page to a bitmap before saving

The SDK handles page iteration and file numbering.

## Complete implementation

The following example exports each page from a multi-page PDF as a separate PNG file.

Import the required Nutrient classes:

```python

from nutrient_sdk import Document
from nutrient_sdk import NutrientException

```

Then open the multi-page PDF and export it as PNG. The SDK detects the output format from the `.png` extension and writes one file for each page:

```python

def main():
    try:
        with Document.open("input.pdf") as document:
            document.export_as_image("output.png")
            print(f"Converted {document.page_count} page(s); see output-1.png, output-2.png,...")
    except NutrientException as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()

```

## Output

For a multi-page input PDF, this call writes numbered files like:

- `output-1.png`

- `output-2.png`

The original `output.png` filename serves as the template. The SDK appends `-N` before the file extension for each page, using one-based numbering.

For single-page documents, the SDK keeps the literal filename unchanged. For that workflow, refer to the [PDF to image](https://www.nutrient.io/guides/python/conversion/pdf-to-image.md) guide.

## Choosing the format

The output behavior depends on the file format you choose.

| Format                 | Multi-page behavior                |
| ---------------------- | ---------------------------------- |
| TIFF (`.tiff`, `.tif`) | All pages are embedded in one file |
| PNG (`.png`)           | One numbered file per page         |
| JPEG (`.jpg`, `.jpeg`) | One numbered file per page         |
| BMP (`.bmp`)           | One numbered file per page         |

To override extension-based format detection, set `ImageSettings.ExportFormat` before calling `export_as_image`.

## Summary

The overall process matches the single-page workflow. You choose the output format with the file extension, and the SDK exports each page using the appropriate file pattern.

To run the example locally, download the [sample](https://www.nutrient.io/downloads/samples/python/pdf-pages-to-images.zip) package.
---

## Related pages

- [Converting CAD files (DWG/DXF) to PDF format](/guides/python/conversion/cad-to-pdf.md)
- [Converting a document from XLSX to PDF format](/guides/python/conversion/excel-document-to-pdf.md)
- [Converting HTML to PDF](/guides/python/conversion/html-to-pdf.md)
- [Converting email files (MSG/EML) to PDF format](/guides/python/conversion/email-to-pdf.md)
- [Nutrient Python SDK conversion guides](/guides/python/conversion.md)
- [Converting PDF documents to Excel format for data analysis](/guides/python/conversion/pdf-to-excel-document.md)
- [Converting a document from Markdown to PDF format](/guides/python/conversion/markdown-to-pdf.md)
- [Converting PDF documents to HTML format for web publishing](/guides/python/conversion/pdf-to-html.md)
- [Converting PDF documents to image format](/guides/python/conversion/pdf-to-image.md)
- [Converting PDF documents to PowerPoint presentations](/guides/python/conversion/pdf-to-powerpoint-document.md)
- [Converting PDF documents to PDF/A format](/guides/python/conversion/pdf-to-pdf-a.md)
- [Converting a document from PDF to DOCX format](/guides/python/conversion/pdf-to-word-document.md)
- [Converting PDF documents to PDF/UA format](/guides/python/conversion/pdf-to-pdf-ua.md)
- [Converting a document from PPTX to PDF format](/guides/python/conversion/powerpoint-document-to-pdf.md)
- [Converting a document from DOCX to PDF/UA format](/guides/python/conversion/word-document-to-pdf-ua.md)
- [Converting a Word document to PDF while preserving comments](/guides/python/conversion/word-document-to-pdf-including-comments.md)
- [Converting a document from DOCX to PDF format](/guides/python/conversion/word-document-to-pdf.md)
- [Converting PDF documents to Markdown format](/guides/python/conversion/pdf-to-markdown.md)

