API & MCP
Everything a person can do on PDF ↔ Image Converter, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://pdfimageconverter.usefulweb.site/api/v1/calculate– run PDF ↔ Image ConverterGET https://pdfimageconverter.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
PDF ↔ Image Converter
Renders the pages of a PDF as PNG or JPG at 72–300 DPI (one image, or a ZIP for several pages) with a preview of the first page. In the other direction it packs JPG, PNG, TIFF, GIF or WebP images into one PDF; JPG and PNG are embedded losslessly with img2pdf, and you choose page size, fit and order.
| Field | Type | Default | Description |
|---|---|---|---|
direction | select (pdf-to-images, images-to-pdf) | "pdf-to-images" | Conversion |
file (required) | file | — | PDF or image. Max 100 MB in total. |
file2 | file | — | Image 2 (images to PDF). Optional additional image. |
file3 | file | — | Image 3 (images to PDF). Optional additional image. |
file4 | file | — | Image 4 (images to PDF). Optional additional image. |
file5 | file | — | Image 5 (images to PDF). Optional additional image. |
zip | file | — | ZIP with more images (images to PDF). Optional: up to 25 images in total, added after the single files in file-name order. |
format | select (png, jpeg) | "png" | Image format (PDF to images) |
dpi | integer | 150 | Resolution (PDF to images). 72 = screen size, 150 = good for reading, 300 = print quality. |
pages | text | — | Pages (PDF to images). Page numbers start at 1. Examples: "1-3,5,8-end", "odd", "even", "reverse", "10-1" (descending), "1-9:odd". Leave empty for all pages. At most 100 pages per run. |
jpegQuality | integer | 90 | JPG quality |
pageSize | select (image, a4, a4-landscape, letter, letter-landscape) | "image" | Page size (images to PDF) |
fit | select (into, fill, exact) | "into" | Fit on the page (images to PDF) |
margin | number | 0 | Margin (images to PDF, fixed page sizes). 72 pt = 1 inch = 25.4 mm. |
order | text | — | Image order. Numbers of the images in the order to use, e.g. "2,1,3". Empty = upload order. |
password | text | — | PDF password (only if the file is protected). Used only to open the file for this conversion; it is written to a private temporary file, never to a command line, and deleted with the job. |
Example request
Two-page PDF to PNG at 72 DPI
curl -X POST https://pdfimageconverter.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"direction":"pdf-to-images","format":"png","dpi":72,"file":{"filename":"slides.pdf","contentType":"application/pdf","contentBase64":"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUiA1IDAgUl0gL0NvdW50IDIgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA0MDAgMzAwXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA3IDAgUiA+PiA+PiAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCAzOCA+PgpzdHJlYW0KQlQgL0YxIDI0IFRmIDcyIDIwMCBUZCAoU2xpZGUgMSkgVGogRVQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQgMiAwIFIgL01lZGlhQm94IFswIDAgNDAwIDMwMF0gL1Jlc291cmNlcyA8PCAvRm9udCA8PCAvRjEgNyAwIFIgPj4gPj4gL0NvbnRlbnRzIDYgMCBSID4+CmVuZG9iago2IDAgb2JqCjw8IC9MZW5ndGggMzggPj4Kc3RyZWFtCkJUIC9GMSAyNCBUZiA3MiAyMDAgVGQgKFNsaWRlIDIpIFRqIEVUCmVuZHN0cmVhbQplbmRvYmoKNyAwIG9iago8PCAvVHlwZSAvRm9udCAvU3VidHlwZSAvVHlwZTEgL0Jhc2VGb250IC9IZWx2ZXRpY2EgL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcgPj4KZW5kb2JqCnhyZWYKMCA4CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMDY0IDAwMDAwIG4gCjAwMDAwMDAxMjcgMDAwMDAgbiAKMDAwMDAwMDI1MyAwMDAwMCBuIAowMDAwMDAwMzQxIDAwMDAwIG4gCjAwMDAwMDA0NjcgMDAwMDAgbiAKMDAwMDAwMDU1NSAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDggL1Jvb3QgMSAwIFIgPj4Kc3RhcnR4cmVmCjY1MgolJUVPRgo="}}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://pdfimageconverter.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
pdf_image_converter - Local stdio connector:
node src/mcp-stdio.ts --tool=pdf-image-converter
{
"mcpServers": {
"pdf-image-converter": { "type": "http", "url": "https://pdfimageconverter.usefulweb.site/mcp" }
}
}