# PDF to Image: PDF Pages to PNG or JPG in Bulk (`ucchiii/pdf-to-image`) Actor

Convert public PDF links to images: one PNG, JPG or WebP per page at up to 300 DPI, saved with a public link. Choose a page range like 1-3,5 and a page limit per file. One row per page with size and bytes. Empty input = free demo.

- **URL**: https://apify.com/ucchiii/pdf-to-image.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.31 / 1,000 page images

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**PDF to Image: convert PDF links to PNG, JPG or WebP images, one per page, at up to 300 DPI**

Marketers, support teams and developers who get documents as PDF links, such as catalogs, menus, flyers, reports or contracts, often need each page as a picture: for a website, a slide, a chat message, a thumbnail or an image model. Opening every PDF in a desktop tool and exporting page by page does not scale. Paste the PDF links, choose PNG, JPG or WebP, pick the DPI, and press Start. Every page becomes an image file in the run's storage, and the dataset has one row per page with width, height, file size and a public link.

### What you get

| status | sourceUrl | page | pageCount | width | height | dpi | format | bytes | imageUrl |
|---|---|---|---|---|---|---|---|---|---|
| ok | https://example.com/menu.pdf | 1 | 4 | 1241 | 1754 | 150 | png | 210,455 | https://api.apify.com/v2/key-value-stores/.../records/001-menu-p0001.png |
| failed | https://example.com/missing.pdf | | | | | | | | *(error: The server answered HTTP 404 ...)* |

**Try it free:** leave the PDF list empty and press **Start**. A built-in 2-page sample PDF becomes 2 PNG images. Not charged; the rows carry `_demo: true`.

### How to use

1. **PDF URLs**: public links to PDF files, one per line.
2. **Image format**: PNG (lossless, sharp text), JPG (small, photos) or WebP (smallest).
3. **Resolution (DPI)**: 150 by default, up to 300 for print.
4. Optional: **Page range** (`1-3,5`, `7-`, `-3`), **Max pages per PDF**, **JPG / WebP quality**.

```json
{
  "pdfUrls": ["https://example.com/menu.pdf", "https://example.com/report.pdf"],
  "format": "jpg",
  "dpi": 150,
  "pages": "1-3,5",
  "maxPagesPerPdf": 50,
  "quality": 85
}
```

### How the images are made

- **Pages are rendered with PDFium**, the PDF engine of Chrome, so fonts, vector graphics and embedded images look like in a browser. White page background; transparency becomes white.
- **File names**: `001-menu-p0001.png`, that is the PDF's position in your list, its file name and the page number. Open `imageUrl` to view or download one page; all files are also listed under the run's key-value store.
- **Pixel limit**: a page is limited to 9 megapixels (A4 at 300 DPI fits). A larger page, such as a poster, is rendered at a lower DPI automatically so the run stays stable; the `dpi` column shows the DPI actually used.
- **Page range** counts from 1 and applies to every PDF. **Max pages per PDF** (default 50, up to 500) is applied after the range.
- Rotated pages are rendered upright as the PDF shows them.

### Output fields

- `status` (`ok` or `failed`), `error` (the reason when a PDF or page failed)
- `sourceUrl`, `page` (from 1), `pageCount` (pages in the PDF)
- `width`, `height` (pixels), `dpi` (used), `format`, `bytes`
- `imageKey`, `imageUrl`: the image in the run's key-value store

A **STATS** record sums up PDFs converted and failed, pages charged, the options used and whether the run stopped early. Download the rows as CSV, Excel or JSON from the run page.

### Limits (cannot be raised by input)

- 200 PDF URLs per run; 50 MB per PDF; 2,000 pages per run; 9 megapixels per page
- Polite downloading: one PDF at a time, at least 0.5 seconds between requests to the same website
- Public PDFs only (no login); links to internal network addresses are blocked
- Password-protected and damaged PDFs are reported as failed (free)
- Set a maximum charge per run to cap spend: the run stops cleanly when it is reached and keeps the pages made so far

### Pricing

Pay per event: **$0.0033 per page image**, the same for a 36 DPI thumbnail and a 300 DPI print page. Failed downloads, unreadable PDFs, failed pages, invalid input and the demo are free.
Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%.

### Your responsibility

You supply the PDF links and you are responsible for having the right to download and convert those documents (copyright, license, the terms of the website that hosts them). This Actor only fetches the links you give it, one request each, and never browses or crawls.

### FAQ

**Can I convert PDF to JPG?** Yes: set Image format to JPG. Use PNG for text-heavy pages and JPG for photos.

**Can I convert only some pages?** Yes: use Page range, for example `1-3,5`.

**Does it read text from scanned PDFs?** No, it only makes images. For text, see PDF to Text.

**Can I turn images back into a PDF?** Yes, with Images to PDF.

**How long are the files kept?** As long as the run's storage is kept under your Apify plan's data retention. Download them or copy them to your own storage if you need them longer.

**Open-source libraries used:** pypdfium2 and PDFium (Apache-2.0 / BSD-3) for rendering, Pillow (HPND) for image encoding.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [Images to PDF](https://apify.com/ucchiii/images-to-pdf) — combine image URLs into one PDF or one PDF per image: A4, Letter or fit, margins
- [PDF to Text Converter](https://apify.com/ucchiii/pdf-to-text) — plain text per page from public PDF URLs, plus one .txt file per PDF
- [PDF Extractor](https://apify.com/ucchiii/pdf-extractor) — PDF to text, tables and metadata from public PDF URLs, page by page
- [Image Converter](https://apify.com/ucchiii/image-converter) — convert images between JPG, PNG, WebP and AVIF, with optional resize

# Actor input Schema

## `pdfUrls` (type: `array`):

Public http(s) links to PDF files, one per line (up to 200 per run, 50 MB each). Only use PDFs you have the right to convert. Leave empty for a free demo on a built-in 2-page sample PDF.

## `format` (type: `string`):

File type of the page images. PNG keeps text sharp, JPG and WebP are smaller. Transparent areas become white.

## `dpi` (type: `integer`):

Dots per inch, 36-300. 150 suits screens and sharing, 300 suits print. A page that would exceed 9 megapixels is rendered at a lower DPI automatically (the dpi column shows what was used).

## `pages` (type: `string`):

Pages to convert, counted from 1, for example 1-3,5 or 7- (page 7 to the end) or -3 (first 3). Applies to every PDF. Leave empty for all pages.

## `maxPagesPerPdf` (type: `integer`):

Stops after this many pages of each PDF (after the page range is applied). Protects you from converting a 900-page PDF by accident.

## `quality` (type: `integer`):

1-100, used only for JPG and WebP. Higher = sharper but larger files. PNG is always lossless.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "format": "png",
  "dpi": 150,
  "maxPagesPerPdf": 50,
  "quality": 85
}
```

# Actor output Schema

## `pages` (type: `string`):

One row per converted page: source PDF, page number, width, height, DPI, format, file size and a public link to the image, plus one row for each PDF or page that failed with the reason.

## `files` (type: `string`):

The key-value store that holds the image files.

## `stats` (type: `string`):

Record STATS: PDFs converted and failed, pages charged, the options used and whether the run stopped early.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/pdf-to-image").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/pdf-to-image").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call ucchiii/pdf-to-image --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/pdf-to-image"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Np2RNE8h19zENxFla/builds/U0YPhZTGiJaUR7qHM/openapi.json
