# PDF to JPG Converter - PDF Pages to Images (`marcel-rbro/pdf-to-jpg`) Actor

Convert PDF to JPG online in seconds. Every page becomes an image, returned as a ZIP with one file per page. Also outputs PNG, WebP and TIFF at a DPI you choose. Up to 100 documents per run, with a page range when you only need part of a file.

- **URL**: https://apify.com/marcel-rbro/pdf-to-jpg.md
- **Developed by:** [Marcel Rebro](https://apify.com/marcel-rbro) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

Convert **PDF to JPG** online, or to PNG, WebP or TIFF. Upload one PDF or a hundred and get every page back as an image, with a ZIP of the lot. Choose a page range, set the resolution from 36 to 600 DPI, and run it from the Console, the API or an AI agent. No install and no watermark.

A PDF is a description of a page, not a picture of one. That is exactly what you want for printing and exactly what you do not want when the thing needs to go into a slide, a CMS, a marketplace listing or a chat message that will not take a PDF attachment. Rasterising a page is the boring step in between, and this Actor is a wrapper around the two tools that have done it properly for thirty years: Ghostscript renders the page, ImageMagick writes the image.

- 📄 **Every page, or just the ones you want** - `all`, `4`, `2-7`, `5-`, or `1,3,8-10`
- 📚 **Batch conversion** - drop in a folder's worth of PDFs and get one ZIP back, a folder per document
- 🖼️ **Four output formats** - JPEG, PNG, WebP and TIFF, at a quality you choose
- 🔍 **36 to 600 DPI** - 150 for reading on screen, 300 for print and OCR
- 🫥 **Transparent backgrounds** - render a logo or a signature onto nothing, in PNG, WebP or TIFF
- 🛟 **One bad file does not sink the batch** - it is reported and skipped, the rest convert
- 🧨 **Refuses PDF bombs** - page and pixel caps stop a 40 kB file describing ten thousand pages
- 🔌 **Runs from the API, a schedule or an integration** - it is an Apify Actor, so Zapier, Make, n8n and MCP clients can call it

### How to convert PDF to JPG

1. Click **Try for free** and sign in to Apify.
2. Upload your PDFs in the **PDF files** field, or paste direct URLs to them.
3. Leave **Convert to** on `jpeg`, or pick another format.
4. Leave **Pages** on `all`, or type a page number or range.
5. Click **Start**.
6. Download the images from the **Storage** tab. Anything more than a single page is also stored as one ZIP.

#### How to convert several PDFs in one run

Put them all in the **PDF files** field - up to 100 per run. Every document is converted with the same settings, and the result is a single ZIP with **one folder per source document**:

```
pages.zip
├── invoice-january/
│   ├── page-1.jpg
│   └── page-2.jpg
├── invoice-february/
│   └── page-1.jpg
└── contract/
    ├── page-1.jpg
    ├── page-2.jpg
    └── page-3.jpg
```

Folder names come from the filenames, with the extension dropped. Two documents called `report.pdf` do not overwrite each other: the second becomes `report-2`, and the suffix keeps counting until it finds a name nothing else has taken.

**A bad file does not stop the batch.** A corrupt PDF, a password-protected one or a URL that 404s gets `ok: false` and a plain-language reason on its own dataset record, and every other document still converts. The run only fails if nothing at all could be converted. So a batch of forty tells you exactly which two were bad and why.

**Every page is also stored under its own key**, and each document's record carries a direct URL for each of its pages. The ZIP is a convenience on top of that, not the only copy. Records are pushed as each document finishes, so a run that stops half way through still has every result up to that point.

**Very large results get a manifest instead of a ZIP.** The archive has to be assembled in memory to be uploaded, so it is capped at 200 MB. Past that the Actor writes a JSON manifest listing every page's key and URL, and puts that at `OUTPUT` in place of the archive. This Actor produces the largest results in the converter family - one PDF fans out to many images, and a batch multiplies that - so the cap is reachable in practice: 60 Letter pages of TIFF at 150 DPI is already 241 MB. Choosing JPEG, or a lower DPI, keeps you well under it.

The `pages` range applies to every document in the run, which is genuinely useful for uniform documents - `pages: "1"` over sixty scanned invoices gives you sixty cover images.

#### How to convert PDF to PNG

Same steps, with **Convert to** set to `png`. PNG is the better choice for pages that are mostly text, tables, diagrams or screenshots: it is lossless, so letterforms and thin rules stay clean instead of picking up the soft halo that JPEG puts around high-contrast edges. The files are larger, often several times larger. Use JPEG for scans and photographs, PNG for anything that started life as vector.

#### How to convert PDF to image

Pick the format by what is on the page rather than by habit.

| Format | Use it for | Lossless | Transparency |
|---|---|---|---|
| **JPEG** | Scans, photographs, pages with large images | No | No |
| **PNG** | Text, tables, diagrams, screenshots, logos | Yes | Yes |
| **WebP** | The same jobs as JPEG or PNG, at a smaller size, where the consumer is a browser | Either | Yes |
| **TIFF** | Print workflows and archiving, where a lossless master is expected | Yes | Yes |

WebP is worth a look if the images are going onto a web page: it is roughly 25 to 35% smaller than JPEG at a matched quality and every current browser reads it. TIFF exists here because print shops and document management systems still ask for it.

#### How to convert PDF pages to images

The **Pages** field takes five forms:

| `pages` | Converts |
|---|---|
| `all` | Every page. The default. |
| `4` | Page 4 only. |
| `2-7` | Pages 2 to 7. |
| `5-` | Page 5 to the end. |
| `1,3,8-10` | Pages 1, 3, 8, 9 and 10. |

Pages are numbered from 1, the same as your PDF reader shows them. A range that runs past the end of the document is clamped rather than rejected, so `1-100` on a twelve-page file converts all twelve.

**Naming follows the page numbers, not the position in the range.** Asking for `3-5` gives you `page-3.jpg`, `page-4.jpg` and `page-5.jpg`, so a filename always tells you which page of the original you are looking at. A single page of a single document is stored under that document's own name instead, since a one-page conversion is just a file.

#### How to convert PDF to WebP

Set **Convert to** to `webp`. The **Quality** field applies, exactly as it does for JPEG. Turn on **Transparent background** if the page should keep its transparency.

#### How to convert PDF to TIFF

Set **Convert to** to `tiff`. TIFF is lossless, so **Quality** is ignored and the files are the largest of the four formats by a wide margin. At 300 DPI an A4 page is around 25 MB.

#### What DPI should I use to convert PDF to JPG?

**The default is 150 DPI**, which turns an A4 page into roughly 1240 x 1754 pixels and a US Letter page into 1275 x 1650. That is a page you can read comfortably on a screen at full size, at a file size measured in tens of kilobytes, and it is the right answer for the common case: putting a page into a document, a ticket, a listing or a message.

| DPI | A4 page | Use it for |
|---|---|---|
| 72 | 595 x 842 | Thumbnails and previews |
| **150** | 1240 x 1754 | Reading on screen, embedding in documents. **The default.** |
| 300 | 2480 x 3508 | Printing, OCR, archiving |
| 600 | 4960 x 7016 | Fine detail in line art or small type |

The reason not to default to 300 is arithmetic: **doubling the DPI quadruples the pixels**, and with them the render time, the memory and the file size. Most people converting a PDF to JPG are not going to print the result, so charging every run four times over for a resolution most callers do not need is the wrong default. Set 300 deliberately when you are printing the image or feeding it to OCR, where the extra pixels genuinely change the outcome.

In a batch the DPI matters more than it does for one file, because the pixel cap is a run-wide total. At 300 DPI a run allows roughly 95 A4 pages; at 150 DPI it allows around 360.

### Input

Upload the files in the **PDF files** field, or pass direct URLs to them.

| Field | Description |
|---|---|
| `files` | The PDFs to convert. File uploads or URLs, up to 100 of them. |
| `file` | A single PDF as one URL. A hidden field, kept so existing API callers and saved input configurations keep working. Ignored when `files` is filled in. |
| `outputFormat` | `jpeg` (default), `png`, `webp` or `tiff`. |
| `dpi` | Rendering resolution, 36 to 600. Default 150. |
| `pages` | `all` (default), `4`, `2-7`, `5-` or `1,3,8-10`. Applies to every document in the run. |
| `quality` | 1 to 100, default 90. Used by JPEG and WebP; ignored by the lossless formats. |
| `transparentBackground` | Render onto transparency rather than white. PNG, WebP and TIFF only. |
| `outputFilename` | Base name for a single document's result, or for the batch ZIP. Defaults to the input filename, or `pages.zip` for a batch. |
| `fileBase64`, `filename` | A single file as base64, for API callers who prefer JSON to a URL. |
| `verboseLog` | Include the full ImageMagick and Ghostscript output in the Actor log. |

### Output

Every converted page is written to the run's key-value store, so it is downloadable from the **Storage** tab.

| Conversion | Records written |
|---|---|
| One PDF, one page | The image under the document's own filename, and `OUTPUT` (the same image) |
| One PDF, several pages | `page-1.jpg`, `page-2.jpg` and so on, a flat ZIP of them, and `OUTPUT` (the ZIP) |
| Several PDFs | `<document>-page-1.jpg` for every page, a ZIP with one folder per document, and `OUTPUT` (the ZIP) |
| Anything over 200 MB | Every page as above, plus a JSON manifest of their keys and URLs at `OUTPUT`, in place of the ZIP |

`OUTPUT` is the record that the `run-sync` API endpoint returns in its HTTP response body, so it holds whatever a caller most likely wants back in one piece: the image when there is a single page of a single document, and the archive in every other case.

**One dataset record per input PDF**, converted or not, carrying `ok`, the failure reason if there is one, the page count, the page dimensions, and every rendered page with its store key, direct URL and path inside the archive. Records are pushed as each document finishes rather than all at the end. A single-PDF run therefore still produces exactly one record.

### How much does it cost to convert PDF to JPG?

| Job | Run time | Cost |
|---|---|---|
| A4 3-page PDF at 150 DPI | 11.4 s | **$0.0011** |
| A4 3-page PDF at 300 DPI | 13.8 s | **$0.0015** |

Measured 2026-08-26 on the Free plan at the default 1024 MB, read back from the run API.

**A document costs a fraction of a cent**, and Apify's [free plan](https://apify.com/pricing)
includes $5 of usage a month.

**Batching saves startup, not rendering.** Several seconds of every run go on pulling and starting
the container, whatever you asked it to do, and that is paid once per run. Twenty PDFs in one run
pays it once; twenty runs pay it twenty times for identical rendering work. If you have more than one
file, put them in `files` rather than looping over the API.

**Doubling the DPI is cheaper than it sounds.** Pixels go up with the square of the DPI, so 300 DPI
is about four times the rendering work of 150 - but rendering is not the whole run. On the three-page
document above, doubling the DPI moved the bill from $0.0011 to $0.0015, because container startup
dominates a short job. On a long batch at high DPI the quadratic term is what you would actually feel.

Compute is roughly half the bill; the rest is key-value store writes and data transfer, which scale
with how many page images you produce.

Memory is worth a thought for large jobs. Apify allocates one CPU core per 4096 MB, so the default
1024 MB gets a quarter of a core. Rendering is CPU-bound in a way a single photo conversion is not,
so a long high-DPI batch may finish sooner, and no dearer, at higher memory. Measure before assuming.

### How to convert PDF to JPG with the API

`run-sync` returns the result in the response body. For a single page of a single document, that is the image:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~pdf-to-jpg/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"file": "https://example.com/report.pdf", "pages": "1", "outputFormat": "jpeg", "dpi": 150}' \
  --output page-1.jpg
```

In every other case the same endpoint returns the ZIP. Several pages of one document give a flat archive:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~pdf-to-jpg/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"file": "https://example.com/report.pdf", "pages": "all", "outputFormat": "png", "dpi": 300}' \
  --output pages.zip
```

Several documents give one folder per document inside it:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~pdf-to-jpg/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"files": ["https://example.com/jan.pdf", "https://example.com/feb.pdf"], "pages": "1"}' \
  --output pages.zip
```

If you hold the bytes rather than a URL, pass them as base64 in `fileBase64`. The Apify API requires Actor input to be `application/json` and rejects anything else with HTTP 400 before the run starts, so a URL or base64 are the two ways in. `fileBase64` takes one file only; use `files` with URLs for a batch:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~pdf-to-jpg/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d "{\"fileBase64\": \"$(base64 < report.pdf)\", \"filename\": \"report.pdf\", \"pages\": \"1-5\"}" \
  --output pages.zip
```

Base64 adds about a third to the payload, so prefer a URL for large files.

To fetch the pages individually rather than as an archive, or to find out which files in a batch failed, use `run-sync-get-dataset-items`: you get one record per input PDF, each with `ok`, an `error` if it has one, and a `pages` array of direct URLs. Note that a result over 200 MB returns a JSON manifest rather than a ZIP body, so check the response content type if you are converting at a high DPI.

`run-sync` waits up to 300 seconds. A batch, or a long document at a high DPI, can exceed that, so use the asynchronous [Run Actor](https://docs.apify.com/api/v2/act-runs-post) endpoint for large jobs. There are [client libraries for JavaScript and Python](https://docs.apify.com/api/client), and the same run can be triggered on a schedule or from Zapier, Make, n8n, Slack or an MCP client.

### Limitations

- **100 files, 200 pages and 800 megapixels per run.** All three are **run-wide totals**, not per-document ones, because fifty ten-page PDFs are the same amount of work as one five-hundred-page PDF and should be treated as such. The pixel ceiling is the one you meet first at a high DPI: 200 A4 pages at 300 DPI is around 1700 megapixels and is refused, with a message saying how many pages that run allows at that resolution. Convert in slices with `pages`, or lower the DPI.
- **200 MB of input per run**, in total and per file. The same aggregation argument.
- **The ZIP is capped at 200 MB.** It has to be assembled in memory to be uploaded. Past the cap you get a JSON manifest of every page's key and URL instead, and the pages themselves are stored either way.
- **No single page over 100 megapixels.** That is a 60 x 60 inch page at 150 DPI, or A4 at well over 600 DPI. Posters, plans and maps hit it; lower the DPI. In a batch this fails only that document, not the run.
- **One set of settings per run.** Format, DPI, quality and page range apply to every document. Converting page 1 of one PDF and all of another means two runs. `outputFilename` names the archive, not the pages.
- **Password-protected PDFs fail.** The Actor reads the encryption flag and stops with an explanation rather than a Ghostscript error. In a batch, only that file fails. Open it with its password, save an unprotected copy, and convert that.
- **PostScript and EPS are deliberately not supported.** They are the far larger half of Ghostscript's attack surface and no PDF converter needs them. See the FAQ below.
- **No text extraction.** The output is a picture of the page. Text on it is pixels, not characters. If you want the words, you want a PDF text extractor or OCR, not this.
- **No JPG to PDF.** That is the other direction, and a [separate Actor](https://apify.com/marcel-rbro/jpg-to-pdf).

### Other file converters

| Actor | Converts |
|---|---|
| **PDF to JPG converter** (this one) | PDF → JPEG, PNG, WebP, TIFF |
| [JPG to PDF converter](https://apify.com/marcel-rbro/jpg-to-pdf) | JPEG, PNG → PDF |
| [Word to PDF converter](https://apify.com/marcel-rbro/word-to-pdf) | DOC, DOCX → PDF |
| [HEIC to JPG converter](https://apify.com/marcel-rbro/heic-to-jpg) | HEIC, HEIF, AVIF → JPEG, PNG, WebP, AVIF, TIFF |
| [PNG to JPG converter](https://apify.com/marcel-rbro/png-to-jpg) | PNG → JPEG |
| [EPUB to PDF converter](https://apify.com/marcel-rbro/epub-to-pdf) | EPUB → PDF |
| [MOBI to EPUB converter](https://apify.com/marcel-rbro/mobi-to-epub) | MOBI, PRC, AZW, AZW3 → EPUB |

### FAQ

#### Is this PDF to JPG converter free?

Apify's free plan includes $5 of platform usage per month and needs no card, which covers a lot of documents. There is no per-file charge, no watermark and no page limit beyond the run caps described above.

#### Can I convert a whole folder of PDFs at once?

Yes, that is what the **PDF files** field is for - up to 100 documents in one run, with a combined ceiling of 200 pages and 800 megapixels. You get one ZIP with a folder per document, and one dataset record per document telling you how it went. Doing it this way is also markedly cheaper than one run per file, because container startup is most of the cost of a short run and a batch pays it once.

#### What happens if one PDF in the batch is corrupt?

It is skipped and reported. That document's dataset record gets `ok: false` and an `error` saying why in plain language, the log carries a warning naming the file, and every other document converts as normal. The run itself only fails if no file at all could be converted. The final log line and status message say how many converted and how many failed.

#### What is the best quality setting for PDF to JPG?

Two settings decide it and they do different jobs. **DPI** is how many pixels the page is rendered into, and it is the one that matters: 150 for screen, 300 for print or OCR. **Quality** is how hard JPEG compresses those pixels afterwards, from 1 to 100, and 90 is the default. Raising quality above 90 grows the file quickly for very little visible gain; dropping below about 80 starts to show around text. If pages look soft, raise the DPI rather than the quality. If they look blotchy around lettering, either raise the quality or switch to PNG, which does not compress that way at all.

#### How do I convert a multi-page PDF?

Leave **Pages** on `all`. Every page is stored as its own image, named by its real page number, and all of them are packed into a single ZIP so you can take the document in one download. Through the API, `run-sync` hands you that ZIP directly. If you only want part of the document, `2-7`, `5-` and `1,3,8-10` all work.

#### Can I get a single image with all the pages stacked into one?

No. Each page is rendered as its own image. Combining them into one tall image is a different job and is not what most callers want.

#### Can I convert a scanned PDF?

Yes, and it is the easy case: a scanned page is already a picture, so rendering it is close to a straight re-encode. Match the DPI to the scan - converting a 200 DPI scan at 600 DPI invents no detail and quadruples the file for nothing.

#### Can an AI agent call this converter?

Yes. Every Apify Actor is exposed through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp), so Claude, Cursor and other MCP clients can run this conversion as a tool. It is a reasonable step in front of a vision model: a model that cannot read a PDF can usually read a picture of one.

#### Is it safe to convert a PDF here?

Worth explaining, because the honest answer involves a deliberate decision. ImageMagick does not rasterise PDF itself - it hands the file to Ghostscript, a full PostScript interpreter with a history of sandbox escapes, and Debian ships ImageMagick with the PDF, PostScript, EPS and XPS coders switched off because of it.

An Actor whose job is converting PDF pages cannot keep the PDF block, so the image lifts it narrowly rather than wholesale:

- Only the PDF coder is re-enabled, and only for **reading**. PostScript, EPS and XPS stay blocked, and the Docker build fails if they are ever found readable.
- Every file is checked for a real `%PDF-` header before it reaches ImageMagick, so a `.docx`, an EPS or an HTML error page renamed to `.pdf` is refused by the Actor rather than opened by the interpreter.
- Ghostscript still runs with `-dSAFER`, keeping its own file-access restrictions.
- Every run is a fresh container that is destroyed afterwards, and it holds your files for the length of that run only.

#### The conversion failed. What now?

Turn on `verboseLog` and re-run: the Actor log will carry ImageMagick's and Ghostscript's own output. The common causes are a URL that returns an HTML login page rather than the file, a password-protected PDF, a page range that does not exist in the document, and a resolution high enough to trip the pixel cap. All of them fail with a message that names the problem, and in a batch the dataset record tells you which file it was.

If a specific page fails while the rest convert, that page usually contains a damaged font or image. Convert the page on its own with `pages` to confirm, then re-save the PDF from a reader, which normally rewrites the broken object.

### Development

```bash
npm install
npm test      # tests the PDF inspector, page-range parser, batch planner and ZIP writer; no engine needed
apify run     # needs ImageMagick and Ghostscript on your PATH
```

`npm test` deliberately touches nothing that renders. The conversion path needs Ghostscript, which macOS does not have by default, so the parts worth unit-testing are the pure ones: the header inspector, the page-range parser, the folder-name de-duplication and aggregated cap arithmetic in `src/batch.js`, and the ZIP writer.

Conversion runs ImageMagick in a Debian container with Ghostscript as its PDF delegate and poppler's `pdfinfo` reading each document's page count and page size. ImageMagick 7 renamed `convert` to `magick`; the Actor detects which one is present, so local development on macOS works the same as the Debian image. The Docker build asserts that PDF is readable, that PostScript is not, and that a real PDF converts, so a broken image fails the build rather than every run.

This Actor's code is MIT licensed. ImageMagick, Ghostscript and poppler run as separate processes under their own licences - see [THIRD\_PARTY\_NOTICES.md](THIRD_PARTY_NOTICES.md).

# Actor input Schema

## `files` (type: `array`):

The PDFs to convert, up to 100 per run. Upload files or paste direct URLs. Every page of every document is converted, and the result comes back as one ZIP with a folder per document. Password-protected files are not supported.

## `file` (type: `string`):

Alternative to the PDF files field for a single document, kept so existing API callers and saved input configurations keep working. Ignored when files is filled in.

## `outputFormat` (type: `string`):

JPEG opens everywhere and is the right answer for scans and photo-heavy pages. Choose PNG for pages that are mostly text, diagrams or screenshots: it is lossless, so the text edges stay crisp.

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

How finely each page is rendered. 150 DPI turns an A4 page into roughly 1240 x 1754 pixels, which is right for reading on screen. Use 300 for printing or OCR, and note that doubling the DPI quadruples the pixels, the file size and the render time.

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

Which pages to convert: "all", a single page ("4"), a range ("2-7"), an open range ("5-"), or a comma-separated list ("1,3,8-10"). Applies to every document in the run.

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

Compression quality from 1 to 100, used by JPEG and WebP. 90 keeps text readable without bloating the file. Ignored for PNG and TIFF, which are lossless.

## `transparentBackground` (type: `boolean`):

Renders the page with a transparent background instead of white, so a logo or a signature can be laid over something else. Only applies to PNG, WebP and TIFF; JPEG has no transparency and always gets a white background.

## `outputFilename` (type: `string`):

Base name for the archive, or for the image when a single page of a single PDF is converted. Defaults to the input filename for one PDF and to pages.zip for several. Individual pages are always named after their page number and their source document.

## `fileBase64` (type: `string`):

Alternative to the file field for API callers: the source file encoded as base64. Adds about 33% to the payload size.

## `filename` (type: `string`):

Original filename to use when the file is passed as base64.

## `verboseLog` (type: `boolean`):

Includes the full ImageMagick and Ghostscript output in the Actor log. Useful when a page renders oddly.

## Actor input object example

```json
{
  "outputFormat": "jpeg",
  "dpi": 150,
  "pages": "all",
  "quality": 90,
  "transparentBackground": false,
  "verboseLog": false
}
```

# Actor output Schema

## `convertedResult` (type: `string`):

The converted image for a single page of a single PDF, otherwise the ZIP of every page - one folder per document for a multi-PDF run. A result too large to archive is a JSON manifest of every page's key and URL instead. This is the same record that the run-sync API endpoint returns in its HTTP response body.

## `allFiles` (type: `string`):

Every record in the run's key-value store: one image per converted page, plus the archive.

## `conversionDetails` (type: `string`):

One record per input PDF: whether it converted, page count, resolution, per-page dimensions, sizes, page URLs, and the reason for any file that failed.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("marcel-rbro/pdf-to-jpg").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("marcel-rbro/pdf-to-jpg").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 '{}' |
apify call marcel-rbro/pdf-to-jpg --silent --output-dataset

```

## MCP server setup

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

```

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/9qb5MGNZcoqsMZ2lJ/builds/s4be2fK6bdNZ6x4y9/openapi.json
