Save pages as images
pdf_to_imagesSave every or selected PDF pages as PNG or JPEG images in a folder, with page, DPI, and format options. Use them to share, present, or inspect page layouts.
Instructions
Saves every page, or the chosen pages, of a PDF as PNG or JPEG images named -01.png, -02.png, ... (by page number) in an existing folder, and lists the files with their pixel sizes. Use it to share a page as a picture, insert it into a slide or chat, or look at a page's layout; to read the text, use extract_text, and to make a smaller PDF, use compress_pdf. The PDF is not changed; existing images are only replaced with overwrite: true. Encrypted PDFs cannot be converted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | Resolution, 36 to 600 (default 150; 72 is screen size, 300 is print quality). | |
| path | Yes | Absolute path of the PDF. | |
| pages | No | Pages as 1-based numbers and ranges, e.g. "1-3,5". All pages when omitted; a page outside the document is an error. | |
| format | No | png (default) is sharp for text and drawings; jpeg is smaller for photos and scans. | |
| password | No | Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it. | |
| base_name | No | Start of the file names (default: the PDF's name). | |
| overwrite | No | Allow replacing an existing file (default false). | |
| output_dir | Yes | Absolute path of an existing folder for the images. |