Actions10
Overview
The "Split PDF" operation of this node allows you to split a PDF file into smaller PDFs by extracting specified pages into a new PDF document. This is useful when you want to isolate certain pages from a large PDF for separate processing, sharing, or archiving.
Common scenarios include:
- Extracting chapters or sections from a large report.
- Splitting a multi-page invoice into individual invoices.
- Creating smaller PDFs from a large scanned document for easier distribution.
For example, if you have a 10-page PDF and want to create a new PDF containing only pages 1, 3 to 5, you specify those pages, and the node outputs a new PDF with just those pages.
Properties
| Name | Meaning |
|---|---|
| PDF Binary Field | Name of the binary field containing the PDF file to be split. |
| Pages | Pages to extract/split from the PDF. Can be a single page (e.g., "1"), multiple pages or ranges (e.g., "1,3-5"), or "all" for all pages. |
Output
The output contains a binary field named output which holds the resulting PDF file after splitting. The binary data includes:
data: Base64 encoded PDF content of the extracted pages.fileName: The filename assigned to the output PDF, typicallyoutput.pdf.mimeType: Always"application/pdf"indicating the file type.
No JSON fields are added specifically for this operation; the main result is the binary PDF data.
Dependencies
- Requires the input PDF to be provided as binary data in the specified binary field.
- Uses the
pdf-liblibrary internally to manipulate PDF files. - No external API keys or services are required.
- The node expects the input binary data to have MIME type
application/pdf.
Troubleshooting
Error: No binary data found for [field name]
Ensure that the input item contains binary data under the specified PDF binary field name. The field name must exactly match the one configured in the node.Error: The file must be in PDF format (MIME type: application/pdf). Received: [type]
Verify that the binary data is indeed a PDF file and has the correct MIME type.Error: Invalid page numbers. Pages must be between 1 and [total pages]
Check that the pages string specifies valid page numbers within the range of the PDF's total pages. Use formats like "1", "1,3-5", or "all".Error: Pages to extract are required
Make sure the "Pages" property is set and not empty.
Links and References
- pdf-lib GitHub repository – The underlying library used for PDF manipulation.
- PDF page numbering conventions – Understanding page ranges and numbering.
- n8n documentation on working with binary data