PDF to Image
Converts PDF pages to image files.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- PDF File Path - The path to the PDF file that will be converted to images.
Options
- Output Directory - The directory where the image files will be saved.
- Password - The password for the PDF document if it is encrypted.
- Prefix - A prefix to add to the filenames of the generated images.
- Start Page - The page number to start converting from (1-based index). If 0, starts from the first page.
- End Page - The page number to stop converting at (1-based index). If 0, processes all pages.
- Export Type - The format to save the images. Options include "jpg", "png", etc.
Output
- result - The result of the PDF to image conversion operation.
How It Works
The PDF to Image node converts each page of a PDF document to individual image files. When executed, the node:
- Validates that the input PDF path is not empty
- Checks that the output directory exists
- Loads the PDF document (using the password if provided)
- Splits the document according to the specified start and end pages
- Renders each page as an image with 300 DPI resolution
- Saves each rendered image to the output directory with the specified format and prefix
- Closes all document resources
Requirements
- A valid PDF file path
- An existing output directory
- Sufficient permissions to read the input file and write to the output location
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid PDF File Path
- Output directory does not exist
- Export type is not specified
- File I/O errors
- PDF processing errors
Usage Notes
- Pages are numbered starting from 1
- If Start Page is 0, conversion begins from the first page
- If End Page is 0, all pages from the Start Page are converted
- The default export type is JPG
- Images are rendered at 300 DPI for good quality
- The prefix is added before the page number in the filename