PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

This node operation "Create Images From PDF" converts pages of a PDF document into image files. It supports multiple input methods for the PDF file, including binary data from a previous node, a base64 encoded string, or a URL pointing to the PDF. Users can specify which pages to convert (all, specific pages, or a range), and configure output image settings such as format and width.

This node is beneficial in scenarios where you need to extract visual representations of PDF pages for previews, thumbnails, or further image processing workflows. For example, converting an invoice PDF into JPEG images for display on a website, or extracting specific pages as PNG images for archival purposes.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to convert. Options: Binary Data (from previous node), Base64 String (encoded PDF content), URL (link to PDF file).
Input Binary Field Name of the binary property containing the PDF file when using Binary Data input type (usually "data").
Base64 PDF Content Base64 encoded string of the PDF document content, used if Input Data Type is Base64 String.
PDF URL URL to the PDF file to convert, used if Input Data Type is URL.
Document Name Name of the source PDF file for reference (e.g., "original-file.pdf").
Image Settings Settings for output images: includes Image Width (pixels) with allowed range 100-4000, and Image Format with options like JPG, JPEG, BMP, GIF, JB2, JP2, JPF, JPX, PNG, TIF, TIFF.
Page Selection Which pages to convert: All Pages, Specific Pages, or Page Range.
Page Numbers Comma-separated list of page numbers or ranges (e.g., "1,3,5" or "1-5") to convert, applicable if Page Selection is Specific Pages or Page Range.
Output File Name Prefix Prefix for naming output image files (e.g., "page" results in files named page_1.jpg, page_2.jpg, etc.).
Output Binary Field Name Name of the binary property where the output image files will be stored (default "data").

Output

The node outputs an array of items, each representing one converted image page from the PDF. Each item contains:

  • A json object with metadata about the image (such as page number).
  • A binary property (name configurable by "Output Binary Field Name") containing the image file data in the selected format.

If multiple pages are converted, multiple output items are returned, one per image.

Dependencies

  • Requires access to the PDF file either via binary input, base64 string, or URL.
  • No explicit external API keys or credentials are indicated in the code snippet; however, the node likely depends on an internal PDF processing library or service bundled within the node's implementation.
  • No special environment variables or n8n configurations are specified.

Troubleshooting

  • Common issues:

    • Providing an invalid or inaccessible URL may cause failures in fetching the PDF.
    • Incorrect base64 encoding or corrupted binary data will prevent successful conversion.
    • Specifying page numbers outside the actual PDF page range will likely result in errors or empty outputs.
    • Unsupported image formats or widths outside the allowed range may cause errors.
  • Error messages:

    • Errors related to file reading or decoding usually indicate problems with the input PDF data.
    • Page selection errors occur if requested pages do not exist.
    • Conversion errors might arise from unsupported image formats or internal processing failures.
  • Resolutions:

    • Verify the PDF input source and ensure it is accessible and correctly formatted.
    • Double-check page numbers and ranges against the actual PDF.
    • Use supported image formats and valid width values.
    • Enable "Continue On Fail" option in n8n to handle individual item errors gracefully.

Links and References

Discussion