# PDF to images

Turn PDF pages into PNG, JPG or WebP pictures at the sharpness you choose. Up to 50 pages in one run, as files or one zip.

- Endpoint: `POST https://setget.net/v1/tools/pdf-to-images` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `pdf-to-images`
- Page: https://setget.net/tools/pdf-to-images

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `file` (required, file, a file reference such as `DROP_ID/f1`, accepts pdf): The PDF to turn into pictures.
- `format` (optional, string, one of `png`, `jpg`, `webp`, default `"png"`): Picture format. PNG keeps text perfectly sharp; JPG and WebP are smaller.
- `dpi` (optional, integer, default `150`, range 72..300): Sharpness in dots per inch. 72 matches a screen, 150 reads well, 300 is print quality.
- `pages` (optional, string): Pages to turn into pictures. Page numbers and ranges separated by commas, such as 1-3,5,8- (8- means page 8 to the end). odd, even and last also work. Left empty, every page is used.
- `quality` (optional, integer, default `85`, range 1..100): For JPG and WebP: 1 (smallest file) to 100 (best picture).
- `zip` (optional, boolean, default `false`): Return one zip archive holding the pictures instead of separate files.
- `password` (optional, string): The password of the PDF, if it is locked. It is used once to open the file and is never stored or shown. The result is not locked.

## Example 1: The first page as a PNG

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.pdf](https://setget.net/static/samples/sample.pdf).

```json
{"input":{"file":"DROP_ID/f1","pages":"1"},"wait":30}
```

## Example 2: Every page as a small JPG

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.pdf](https://setget.net/static/samples/sample.pdf).

```json
{"input":{"file":"DROP_ID/f1","format":"jpg","dpi":100},"wait":30}
```

## Example 3: WebP pictures in one zip

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.pdf](https://setget.net/static/samples/sample.pdf).

```json
{"input":{"file":"DROP_ID/f1","format":"webp","dpi":72,"zip":true},"wait":30}
```

**Which dpi should I choose?** 150 is right for reading on a screen and for showing pages to a vision model. Use 300 for printing or for reading small print, and 72 for thumbnails.

**What are the limits?** 50 pages in one run and 25 megapixels for each page. For a longer document, run the tool again with the next pages, for example 51-100.

**I want the photos inside the PDF, not pictures of pages.** Use pdf-extract-images. It saves the pictures stored in the PDF in their original quality.

**Are see-through areas kept?** No. Pages are drawn on white paper, as a viewer shows them.

**Can I use a PDF that is locked with a password?** Yes. Give the password in the password input. It is used once to open the file, is not stored and is not shown anywhere. The result is not locked. Without the right password a locked PDF cannot be read.
