Extract Pages From PDF in n8n
Extract Pages From PDF is a PDF4me node action in n8n that builds a new PDF containing only the pages you list. Use it to pull a signature page out of a contract, isolate a single chapter from a manual, or hand downstream steps just the summary pages instead of the whole document.
What this node does
PDF4me: Extract Pages From PDF takes a PDF from Binary Data, a Base64 String, or a URL and returns a new file holding only the pages named in Page Numbers. That field is the whole action: it accepts single pages, hyphenated ranges, mixed lists, and open ranges that run to the end of the document. Because it runs as a workflow step, the same extraction rule applies to every file that arrives without anyone opening an editor.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate extraction requests securely.
Important Facts You Should Not Miss
10- means page 10 to the end, so one setting works across documents of different lengths.
PDF4me Extract Pages From PDF parameters panel in n8n
Extract Pages vs Split PDF
Both produce smaller documents, but they answer different questions. Extraction asks which pages you want to keep; splitting asks how the whole document should be divided.
| Question | Extract Pages From PDF | Split PDF |
|---|---|---|
| How many files come back | One PDF holding the pages you listed | Several PDFs covering the whole document |
| What happens to unlisted pages | They are absent from the output | They still appear, in another output file |
| Typical use | Pull the signature page, one chapter, or a summary section | Break a bundle into per-invoice or per-section files |
| Driven by | An explicit page list you supply | A split rule such as page count, text, or barcode |
What Parameters Does Extract Pages From PDF Need?
Required: Action, Input Data Type, the field matching that input type, Document Name, and Page Numbers. Output Binary Field Name carries a working default of data, and Advanced Options starts empty.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Action | Required | Selects the PDF4me node action to run. Choose Extract Pages From PDF. | Extract Pages From PDF |
| Input Data Type | Required | Format of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL. | Binary Data |
| Input Binary Field | Conditional | Name of the binary property on the incoming n8n item that holds the PDF. Required when Input Data Type is Binary Data. Defaults to data. | data |
| Base64 Document Content | Conditional | Base64-encoded content of the source PDF. Required when Input Data Type is Base64 String. | JVBERi0xLjQK... |
| File URL | Conditional | Publicly reachable HTTPS URL to the source PDF. Required when Input Data Type is URL. | https://example.com/report.pdf |
| Document Name | Required | Filename used for the document on the request, for reference and tracking. Include the .pdf extension. | output.pdf |
| Page Numbers | Required | The pages to keep. Accepts a comma-separated list, a hyphenated range, a mixed list, or an open range that runs to the end of the document. Pages are numbered from 1. | 1,3,5-8 |
| Output Binary Field Name | Optional | Name of the binary property the output item exposes. Defaults to data. | data |
| Advanced Options | Optional | A collection that starts empty, shown as No properties with an Add Option button. Leave it alone unless you have a specific option to add. | No properties |
How to Write the Page Numbers Field
| Pattern | Example | What comes back |
|---|---|---|
| Single page | 5 | Just page 5, as a one page PDF. |
| Comma-separated list | 1,3,5 | Pages 1, 3, and 5 in one PDF, with pages 2 and 4 absent. |
| Hyphenated range | 2-5 | Pages 2, 3, 4, and 5, with both ends included. |
| Mixed list | 1,3,5-8 | Page 1, page 3, then the block from 5 to 8. |
| Open range | 10- | Page 10 through the last page, whatever the document length turns out to be. |
Output Fields
A successful run returns one n8n item carrying the extracted PDF.
| Field | Type | What it contains |
|---|---|---|
Binary (data) | Binary | The extracted PDF, under Output Binary Field Name (default data). |
fileName | String | Generated filename of the extracted PDF. |
mimeType | String | MIME type of the output, always application/pdf. |
fileSize | Number | Size of the returned PDF in bytes. |
pagesExtracted | Number | How many pages ended up in the output. Compare it against the length of your requested list as a cheap sanity check. |
originalPageCount | Number | Page count of the source document before extraction. |
extractedPageNumbers | Array | The page numbers that were actually extracted, useful for verifying the result against what you asked for. |
success | Boolean | True when the extraction completed, false on failure. Use it to branch error handling. |
message | String | Human-readable status message, carrying success confirmation or error detail. |
How Do I Set Up Extract Pages From PDF in n8n?
- Add PDF4me to your n8n workflow and choose the Extract Pages From PDF action.
- In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
- Set Input Data Type to Binary Data (default), Base64 String, or URL and supply the matching source PDF field.
- Set Document Name for the source file, including the
.pdfextension. - Enter Page Numbers using a list, a range, a mixed list, or an open range.
- Leave Output Binary Field Name as
dataunless a later node expects a different property. - Execute the node and route the returned PDF into the next step, such as storage, email, or a review queue.
Typical Setups
Workflow ExamplesCommon n8n workflow patterns using Extract Pages From PDF.
- A signed contract arrives as an email attachment.
- Extract Pages From PDF takes the last page using an open range.
- The single page is filed against the customer record for quick reference.
- A long report is generated on a schedule.
- Extract Pages From PDF keeps the first few pages with a range such as
1-3. - Reviewers receive the summary while the full report goes to the archive.
- A support request references one section of a product manual.
- Extract Pages From PDF pulls that chapter with a hyphenated range.
- The customer gets the relevant pages instead of a large attachment.
- Several source documents each contain one page worth keeping.
- Extract Pages From PDF runs per document to pull that page.
- Merge Multiple PDFs combines the results into a single digest.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Extract Pages From PDF |
| Input Data Type | Binary Data |
| Input Binary Field | data |
| Document Name | output.pdf |
| Page Numbers | 1,3,5-8 |
| Output Binary Field Name | data |
| Advanced Options | No properties |
| Credentials | PDF4me API credential |