🔄

PDF to Images

Render PDF pages as high-quality PNG or JPEG images at configurable DPI

POST 1 credit /v1/pdf/to-images
curl -X POST "https://pdf.toolkitapi.io/v1/pdf/to-images" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://toolkitapi.io/report.pdf",
    "pages": "1-3",
    "format": "png",
    "dpi": 150
  }'
import httpx

resp = httpx.post(
    "https://pdf.toolkitapi.io/v1/pdf/to-images",
    json={
    "url": "https://toolkitapi.io/report.pdf",
    "pages": "1-3",
    "format": "png",
    "dpi": 150
  },
)
print(resp.json())
const resp = await fetch("https://pdf.toolkitapi.io/v1/pdf/to-images", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://toolkitapi.io/report.pdf",
    "pages": "1-3",
    "format": "png",
    "dpi": 150
  }),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "images": [
    {
      "page": 1,
      "image": "iVBORw0KGgoAAAANSUhEUgAA...",
      "width": 1240,
      "height": 1754,
      "format": "png"
    },
    {
      "page": 2,
      "image": "iVBORw0KGgoAAAANSUhEUgAA...",
      "width": 1240,
      "height": 1754,
      "format": "png"
    }
  ],
  "total_pages": 10,
  "rendered_pages": 2,
  "format": "png",
  "dpi": 150
}

Description

Render PDF pages as high-quality PNG or JPEG images at configurable DPI

How to Use

1

1. Provide the PDF via the `pdf` parameter (base64) or `url` parameter (public URL). You must supply exactly one.

2

2. Optionally set `pages` to render specific pages (e.g. `"1-3,5"`). Omit to render all pages.

3

3. Choose your output `format` — `"png"` (default, lossless) or `"jpeg"` (smaller files). Set `dpi` between 72 and 600 to control resolution.

4

4. Each rendered page is returned as a base64-encoded image with its pixel dimensions, making it easy to display or store.

About This Tool

PDF to Images renders each page of a PDF document as a standalone PNG or JPEG image. You control the output resolution via the DPI setting — higher values produce sharper, larger images suitable for print or zoom, while lower values keep file sizes small for web thumbnails.

Use this tool when you need page previews for a document viewer, want to embed PDF content in a webpage without a PDF plugin, or need to feed PDF pages into an image-based processing pipeline like OCR or computer vision.

Both base64-encoded PDFs and public URLs are accepted as input, so you can process documents already in your system or pull them directly from cloud storage.

Why Use This Tool

Frequently Asked Questions

What DPI should I use?
For web thumbnails, 72–150 DPI is sufficient. For print-quality output, use 300 DPI. Values up to 600 are supported but produce very large images. The default of 150 is a good balance between quality and size.
Can I render just one page?
Yes. Set the `pages` parameter to a single page number like `"1"` or `"5"` to render only that page.
What's the difference between PNG and JPEG output?
PNG is lossless and supports transparency — ideal when you need pixel-perfect rendering. JPEG uses lossy compression, resulting in smaller file sizes but slight quality loss. Use JPEG for thumbnails and PNG for high-fidelity output.

Start using PDF to Images now

Get your free API key and make your first request in under a minute.