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

The node provides functionality to split PDF documents in various ways using the "Split PDF Regular" operation. It supports multiple input methods for the PDF data, including binary data from previous nodes, base64 encoded strings, or URLs pointing to PDF files. Users can specify how to split the PDF, such as splitting after a specific page, recurring splits every N pages, splitting at specific page numbers, or extracting specific page ranges.

This node is beneficial when you need to programmatically divide large PDF files into smaller parts based on page numbers or ranges. For example, it can be used to separate chapters of a book, extract sections of reports, or batch process invoices by splitting them into individual files.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF data:
- Base64 String: Provide PDF content as a base64 encoded string
- Binary Data: Use PDF file from previous nodes
- URL: Provide URL to PDF file
Binary Property Name Name of the binary property containing the PDF file (used only if Input Data Type is Binary Data)
Base64 Content Base64 encoded PDF content (used only if Input Data Type is Base64 String)
PDF URL URL to the PDF file (used only if Input Data Type is URL)
File Name Name of the file from the source; used as the base name for output files
Split Action Choose how to split the PDF:
- Split After Page: Split after a specific page number
- Recurring Split After Page: Split every N pages
- Split Sequence: Split at specific page numbers
- Split Ranges: Extract specific page ranges
Split Action Number Page number for split action (e.g., split after page 1, or every N pages); applicable for "Split After Page" and "Recurring Split After Page"
Split Sequence Comma-separated list of page numbers to split at (e.g., 1,3,8); applicable for "Split Sequence"
Split Ranges Page ranges to extract (e.g., 1-4,10-21); applicable for "Split Ranges"
File Naming File naming convention for split files (details depend on implementation but typically controls how output files are named)
Output Binary Field Name Name of the binary property to store the output PDF file
Advanced Options Collection of advanced options, including:
- Custom Profiles: JSON string to adjust custom properties for API calls, allowing extra options per https://dev.pdf4me.com/apiv2/documentation/

Output

The node outputs an array of items, each containing a json field and a binary field:

  • json: Contains metadata about the split PDF files, such as file names or other relevant information.
  • binary: Contains the actual PDF file data of each split part stored under the user-defined binary property name (default is "data").

This allows subsequent nodes to access the individual split PDF files either as binary data or via metadata.

Dependencies

  • The node relies on the external PDF4me API service to perform PDF splitting operations.
  • Requires an API key credential configured in n8n to authenticate requests to the PDF4me API.
  • Network access to the PDF4me API endpoint is necessary.
  • If using URL input type, the node must be able to fetch the PDF from the provided URL.

Troubleshooting

  • Common Issues:

    • Invalid or missing API key credential will cause authentication failures.
    • Providing an invalid PDF file or corrupted data may result in errors from the PDF4me API.
    • Incorrect page numbers or ranges (e.g., out of bounds) can cause the split operation to fail.
    • Network issues preventing access to the PDF URL or the PDF4me API endpoint.
  • Error Messages:

    • Authentication errors: Check that the API key credential is correctly set up.
    • "Invalid PDF format": Verify the input PDF data is valid and correctly provided.
    • "Page number out of range": Adjust the split page numbers or ranges to fit within the document's page count.
    • Timeout or network errors: Ensure stable internet connection and accessibility to required URLs.

Links and References

Discussion