Extract the images of a PDF
extract_pdf_imagesUse this when the user wants to extract, save or download the images or photos embedded in a PDF. Takes one attached PDF, optional pages (e.g. "2-5"), optional minimum width and height in pixels to skip icons, and dedupe (default true), and returns one ZIP: JPEG images copied as they are stored, other images as PNG (with transparency from a soft mask), and manifest.csv with page, pixel size, colour space and compression of each image. The ZIP is re-opened and each file is checked against its reported size before the link is given. Images in unsupported formats are listed with the reason. Does not open password-protected PDFs, does not render pages or vector drawings as pictures, and does not run OCR.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The PDF whose images you want, e.g. brochure.pdf. | |
| pages | No | Pages to read, e.g. "all" (default) or "1-3, 8, 10-end". | |
| dedupe | No | true (default): an image that appears more than once (same image data) is kept once and its repeats are listed as duplicates. false: list and extract each use. | |
| images | No | Image numbers on one page, as list_pdf_images shows them ("image_on_page"), e.g. "4-end" or "2, 5". Use together with pages set to one page. Default: all images. | |
| min_width | No | Leave out images narrower than this many pixels, e.g. 100 to skip small icons. Default 1 (keep all). | |
| min_height | No | Leave out images shorter than this many pixels, e.g. 100. Default 1 (keep all). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| png | Yes | ||
| file | Yes | ||
| jpeg | Yes | ||
| check | No | ||
| notes | Yes | ||
| pages | Yes | ||
| images | Yes | ||
| listed | Yes | ||
| zip_kb | No | ||
| skipped | Yes | ||
| per_page | Yes | ||
| settings | Yes | ||
| downloads | No | ||
| truncated | Yes | ||
| duplicates | Yes | ||
| pages_read | Yes | ||
| output_name | No | ||
| files_in_zip | Yes | ||
| images_count | No | ||
| images_found | Yes | ||
| skip_reasons | Yes | ||
| inline_images | Yes | ||
| per_page_count | No | ||
| expires_in_hours | No | ||
| smaller_than_minimum | Yes |