0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

The "Split PDF Files" operation of the PDF resource in this node allows users to split a PDF document into multiple parts based on specified criteria. Users can either define explicit page ranges or specify an interval to split the PDF at regular page intervals.

This functionality is useful when you need to extract specific sections from a large PDF, such as splitting chapters, separating invoices, or dividing reports into smaller files for easier distribution or processing.

Practical examples:

  • Splitting a 100-page report into separate PDFs for pages 1-10, 11-20, and so forth.
  • Extracting only certain chapters or sections by specifying exact page ranges.
  • Automatically splitting a PDF every 5 pages to create smaller documents.

Properties

Name Meaning
How Do You Want to Split the PDF? (splitmethod) Choose how to split the PDF:
- Page Ranges: Specify exact start and end pages for each split.
- Interval: Split the PDF into chunks of a fixed number of pages.
Page Ranges (pages) When splitting by page ranges, specify one or more page ranges with:
- Start Page: The first page of the range.
- End Page: The last page of the range.
Interval (interval) When splitting by interval, specify the number of pages per split (e.g., every 3 pages).
URL or Binary Data (datatype) Select whether the input PDF is provided as a public URL or as binary data buffer. Options:
- URL
- Binary Data
URL (url) Public URL of the PDF file to process. Required if datatype is set to URL.
Binary Data (buffer) Buffer containing the PDF file data. Required if datatype is set to Binary Data.
Pages (pages) (Optional) Pages inside the PDF file, used when input is binary data.
Code Variables (codeVariablesUi) Optional collection of code variables that can be passed to the underlying function, allowing dynamic values to be injected during execution. Each variable has:
- Variable Name or ID
- Value

Output

The output JSON contains the results of the split operation. Typically, it will include information about the newly created PDF parts, such as URLs or binary buffers representing each split segment.

If the node is configured to return URLs, the output will contain accessible links to the split PDF files. If binary data is returned, it represents the raw PDF content of each split part.

Dependencies

  • Requires an API key credential for authentication with the external service powering the PDF operations.
  • The node sends requests to an external API endpoint corresponding to the PDF split operation.
  • For URL input, the PDF must be publicly accessible.
  • For binary input, the PDF data must be provided as a base64-encoded string or buffer.

Troubleshooting

  • Invalid page ranges: Ensure that start and end pages are within the actual page count of the PDF and that start page ≤ end page.
  • Incorrect input type: If datatype is set to URL, ensure the URL is publicly accessible and points directly to a PDF file.
  • Buffer format issues: When using binary data, confirm the buffer is correctly encoded and represents a valid PDF.
  • API errors: Authentication failures or quota limits may cause errors; verify API credentials and usage limits.
  • Empty or missing pages parameter: When splitting by page ranges, at least one valid page range must be specified.

Links and References

Discussion