0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

The Split PDF Files operation in the "PDF" resource of this custom n8n node allows users to split a PDF document into multiple parts. The source PDF can be provided either as a URL or as binary data. Users can choose to split the PDF by specifying explicit page ranges or by defining an interval (e.g., every N pages). This is useful for automating document processing workflows, such as extracting specific sections from large PDFs, splitting reports for distribution, or preparing documents for further automated handling.

Practical examples:

  • Splitting a contract PDF into individual agreements per client.
  • Extracting chapters from an eBook based on page ranges.
  • Dividing scanned multi-page invoices into single-invoice files.

Properties

Name Meaning
URL or Binary Data Choose whether the input PDF is provided via a URL or as binary data. Options: URL, Binary Data.
URL The web address of the PDF file to split. Required if "URL or Binary Data" is set to URL.
Binary Data The name of the binary property containing the PDF file. Required if "URL or Binary Data" is set to Binary Data.
How Do You Want to Split the PDF? Select the method for splitting the PDF. Options: Page Ranges (split by specified ranges), Interval (split every N pages).
Page Ranges Specify one or more start and end page pairs to define how the PDF should be split. Only shown if "How Do You Want to Split the PDF?" is Page Ranges. Each range includes:
- Start Page
- End Page
Interval The number of pages per split part. Only shown if "How Do You Want to Split the PDF?" is Interval.

Output

  • The output is a JSON array where each item represents a split part of the original PDF.
  • Each item typically contains metadata about the split file and may include:
    • A URL to the split PDF (if processed as a URL)
    • Or a reference to the binary data (if processed as binary)
    • Additional information such as page range or interval used for the split

Note: If the node is configured to return binary data, the output will contain references to the resulting PDF files in binary format.

Dependencies

  • External Service: Requires access to the CodeKit API (as indicated by the required codeKitApi credential).
  • n8n Configuration: The node must be configured with valid API credentials for CodeKit.

Troubleshooting

Common issues:

  • Invalid URL or Binary Data: Ensure the PDF source is accessible and correctly specified.
  • Incorrect Page Ranges: Specifying invalid or overlapping page ranges may result in errors or unexpected splits.
  • API Authentication Errors: Missing or incorrect API credentials will prevent the node from functioning.
  • Large Files: Very large PDFs may cause timeouts or memory issues depending on server limits.

Error messages:

  • "error": "Some error message": If an error occurs and "Continue On Fail" is enabled, the error message will appear in the output. Check the message for details such as authentication failure, file not found, or invalid parameters.

Links and References

Discussion