PDF to Images
Render PDF pages as high-quality PNG or JPEG images at configurable DPI
/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
{
"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
How to Use
1. Provide the PDF via the `pdf` parameter (base64) or `url` parameter (public URL). You must supply exactly one.
2. Optionally set `pages` to render specific pages (e.g. `"1-3,5"`). Omit to render all pages.
3. Choose your output `format` — `"png"` (default, lossless) or `"jpeg"` (smaller files). Set `dpi` between 72 and 600 to control resolution.
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
- Document previews — Generate thumbnail images for a file browser or document management UI
- Web embedding — Convert PDF pages to images for display in HTML without requiring a PDF viewer
- OCR preprocessing — Render scanned PDFs to images before feeding them into a text recognition pipeline
- Social sharing — Turn report pages into shareable image files for presentations or social media
- Archival snapshots — Create pixel-perfect image backups of important PDF documents
Frequently Asked Questions
What DPI should I use?
Can I render just one page?
What's the difference between PNG and JPEG output?
Start using PDF to Images now
Get your free API key and make your first request in under a minute.