Extract Pages From PDF using n8n action
PDF4me Extract Pages From PDF extracts specific pages from PDF documents through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to extract pages using flexible targeting (specific pages, page ranges, comma-separated values, open ranges) with precise page selection and accurate extraction while preserving page quality. This solution is ideal for page extraction, document segmentation, content isolation, chapter extraction, specific section retrieval, and automated page extraction workflows that require flexible page targeting with reliable extraction and seamless integration.
Setup
Add the PDF4me "Extract Pages From PDF" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites:
- PDF4me API credentials
- n8n workflow access
Configuration:
- Add PDF4me node to workflow
- Select "Extract Pages From PDF" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Extract Pages action. Configure these parameters to control page extraction.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | PDF Input Format Selection • Choose the format of your PDF data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field | Binary | Binary PDF File Input (Required if Binary Data) • Reference PDF file from previous n8n node or file upload • PDF4me processes binary PDF files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Document Content | String | Base64 Encoded PDF Input (Required if Base64 String) • Provide PDF data as base64 encoded string • PDF4me automatically decodes and processes the PDF content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| File URL | String | Public PDF URL Input (Required if URL) • Provide a public/open permission URL to the PDF file • PDF4me downloads and processes the file from URL • Required when Input Data Type is "URL" | https://abc.com/sample.pdf |
| Page Numbers*** | String | Page Extraction Specification • Define which pages should be extracted from the PDF • Supports single pages (1,3,5), ranges (2-5), mixed format (1,3,5-8), or open ranges (10-) • Examples: "1,3,5" or "2-5" or "1,3,5-8" or "10-" or "1,3-5,8,10-12" | 1,2,3 or 2-5 or 1,2,3-7 or 2- |
| Document Name*** | String | Source PDF Reference • Specify the name of the source PDF file • For reference and tracking purposes in page extraction • Helps with processing tracking | document.pdf |
| Binary Data Output Name*** | String | Binary Data Mapping • Define the variable name for accessing generated PDF binary data • Used in subsequent workflow actions • Essential for workflow data flow | data |
Advanced Options
The following parameters are available in the Advanced Options section and are optional:
| Parameter | Type | Description | Example |
|---|---|---|---|
| Custom Profiles | String | Custom Configuration Profiles • Set additional options using custom profiles • JSON-like format containing predefined parameters • Supports outputDataFormat, preserveMetadata, etc. • Optional for specialized requirements | { "outputDataFormat": "json", "preserveMetadata": true, "optimizeForPrinting": false, "compressionLevel": "medium" } |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | PDF4me generated PDF filename - The complete filename of the successfully generated extracted PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processes | extracted_pages.pdf |
| fileSize | Number | PDF4me PDF file size in bytes - The exact size of the generated extracted PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation | 125430 |
| success | Boolean | PDF4me page extraction status indicator - Boolean flag indicating the success or failure of the page extraction process. PDF4me returns true for successful operations and false for any errors, enabling robust error handling in automated workflows | true |
| mimeType | String | PDF4me output MIME type - MIME type of the generated PDF file, always "application/pdf" for PDF documents. Useful for content type validation and proper file handling in web applications | application/pdf |
| message | String | PDF4me page extraction status message - Human-readable status message providing details about the page extraction process result. Includes success confirmation or error details for troubleshooting | Pages extracted from PDF successfully |
| pagesExtracted | Number | PDF4me pages extracted count - The number of pages that were successfully extracted from the PDF document. Useful for tracking extraction effectiveness and document segmentation results | 3 |
| originalPageCount | Number | PDF4me original page count - The total number of pages in the original PDF document before page extraction. Useful for calculating extraction efficiency and document segmentation metrics | 15 |
| extractedPageNumbers | Array | PDF4me extracted page numbers - Array of page numbers that were successfully extracted from the PDF document. Useful for tracking which specific pages were extracted and verifying extraction accuracy | [1, 3, 5] |
N8N Action Response
The PDF4me Extract Pages From PDF API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"success": true,
"message": "Pages extracted from PDF successfully",
"fileName": "extracted_pages.pdf",
"mimeType": "application/pdf",
"fileSize": 125430,
"pagesExtracted": 3,
"originalPageCount": 15,
"extractedPageNumbers": [1, 3, 5]
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| success | true |
| message | Pages extracted from PDF successfully |
| fileName | extracted_pages.pdf |
| mimeType | application/pdf |
| fileSize | 125430 |
| pagesExtracted | 3 |
| originalPageCount | 15 |
| extractedPageNumbers | [1, 3, 5] |
Schema View
The data structure and types of the response:
1 item
success: ☑ true
message: AB Pages extracted from PDF successfully
fileName: AB extracted_pages.pdf
mimeType: AB application/pdf
fileSize: # 125430
pagesExtracted: # 3
originalPageCount: # 15
extractedPageNumbers: [] [1, 3, 5]
Type Indicators:
AB= String#= Number☑= Boolean[]= Array
Binary Data View
The actual extracted PDF file data and metadata:
data
─────────────────────────────
File Name: extracted_pages.pdf
File Extension: pdf
Mime Type: application/pdf
File Size: 122.5 KB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Document Segmentation and Splitting
- Extract specific chapters or sections from large documents for focused distribution
- Create smaller, targeted documents from comprehensive reports or manuals
- Split multi-part documents into individual components for easier management
Content Distribution and Sharing
- Extract relevant pages for different audiences or departments
- Create customized documents by extracting specific content sections
- Share only necessary pages while keeping the original document intact
Automated Document Processing
- Integrate page extraction into document processing workflows
- Automatically extract specific pages during batch processing operations
- Streamline document preparation for different distribution channels and formats