extract_images
Save images embedded in a PDF as separate files, such as page001-image01.png, with options to limit pages, skip small icons, and bypass password protection.
Instructions
Save the pictures in a PDF as image files, in a folder (default: "_images" next to it), named page001-image01.png and so on. pages limits it to a page spec (e.g. "1-3,7"); min_size (pixels) leaves out images narrower or shorter than that, such as icons and rules. Photos are usually saved as the original JPEG; others as PNG (or the format the image is stored in). An image used on several pages is saved once. Images drawn by pages and the forms on them are found; inline images and those inside annotations, patterns or Type 3 fonts are not. Images that are damaged, suspicious (data that doesn't match their size), over 40 million pixels, or past 400 million pixels per call are listed in skipped; only the first 2,000 are read (truncated). Saved files are not password-protected, even if the PDF is. Needs the owner password if the PDF forbids copying.
Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_path": "<input_path>"
},
"name": "extract_images"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | ||
| min_size | No | ||
| password | No | ||
| overwrite | No | ||
| input_path | Yes | ||
| output_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| images | Yes | ||
| skipped | Yes | ||
| truncated | Yes | ||
| output_dir | Yes |