Add Page Number to PDF using n8n action
PDF4me Add Page Number to PDF adds customizable page numbers to PDF documents through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to insert page numbers with flexible positioning (top/bottom, left/center/right), custom formats (1, Page 1, 1 of N), font customization, size control, color options, and page-specific targeting. This solution is ideal for document organization, professional formatting, report generation, legal documents, manuscript preparation, and automated pagination workflows that require consistent numbering with professional appearance and seamless integration.
Setup
Add the PDF4me "Add Page Number to 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 "Add Page Number to PDF" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Add Page Number to PDF action. Configure these parameters to control page numbering.
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 |
| Output File Name*** | String | Enhanced PDF Output Filename • Specify the name for the generated PDF file • Must include .pdf extension • PDF4me ensures unique naming and format validation | document_with_page_numbers.pdf |
| Document Name*** | String | Source PDF Reference • Specify the name of the source PDF file • For reference and tracking purposes • Helps with processing tracking | document.pdf |
| Horizontal Alignment*** | String | Horizontal Page Number Alignment • Choose horizontal positioning of page numbers • Options: Left, Center, Right • PDF4me ensures precise alignment • Essential for professional presentation | Right |
| Vertical Alignment*** | String | Vertical Page Number Alignment • Choose vertical positioning of page numbers • Options: Top, Middle, Bottom • PDF4me provides pixel-perfect positioning • Essential for consistent navigation | Bottom |
| Horizontal Margin (Mm)*** | Number | Horizontal Margin in Millimeters • Set horizontal margin in millimeters • Applied on both left and right sides • Precise millimeter-based positioning • Essential for print-ready output | 2 |
| Vertical Margin (Mm)*** | Number | Vertical Margin in Millimeters • Set vertical margin in millimeters • Applied above and below page number • Ensures consistent vertical spacing • Essential for professional appearance | 2 |
| Font Size*** | Number | Page Number Font Size • Set font size in points for page number text • PDF4me provides precise typography control • Optimal readability across different page sizes • Essential for professional presentation | 12 |
| Set Bold*** | Boolean | Bold Text Formatting • Apply bold formatting to page number text • Enhanced visibility and professional presentation • Creates prominent page numbers • Default is false | false |
| Set Italic*** | Boolean | Italic Text Formatting • Apply italic formatting to page number text • Stylistic emphasis and professional design • Creates elegant page numbers • Default is false | false |
| Skip First Page*** | Boolean | First Page Exclusion • Exclude first page from page numbering • Useful for cover pages or title pages • Flexible pagination control • Default is false | false |
| Binary Data Output Name*** | String | Binary Data Output Mapping • Define the variable name for accessing generated PDF binary data • Used in subsequent workflow actions • Essential for workflow automation | 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 • Enables advanced page numbering settings • Optional for specialized requirements | { "fontFamily": "Arial", "fontColor": "#000000", "startPageNumber": 1 } |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | PDF4me generated PDF filename - The complete filename of the successfully generated PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processes | document_with_page_numbers.pdf |
| fileSize | Number | PDF4me PDF file size in bytes - The exact size of the generated 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 numbering status indicator - Boolean flag indicating the success or failure of the page number addition 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 |
| pageCount | Number | PDF4me processed page count - Number of pages that were processed with page numbers. Provides verification of successful page processing and helps track document enhancement progress | 5 |
| message | String | PDF4me page numbering status message - Human-readable status message providing details about the page number addition process result. Includes success confirmation or error details for troubleshooting | Page numbers added to PDF successfully |
N8N Action Response
The PDF4me Add Page Number to 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": "Page numbers added to PDF successfully",
"fileName": "document_with_page_numbers.pdf",
"mimeType": "application/pdf",
"fileSize": 125430,
"pageCount": 5
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| success | true |
| message | Page numbers added to PDF successfully |
| fileName | document_with_page_numbers.pdf |
| mimeType | application/pdf |
| fileSize | 125430 |
| pageCount | 5 |
Schema View
The data structure and types of the response:
1 item
success: ☑ true
message: AB Page numbers added to PDF successfully
fileName: AB document_with_page_numbers.pdf
mimeType: AB application/pdf
fileSize: # 125430
pageCount: # 5
Type Indicators:
AB= String#= Number☑= Boolean
Binary Data View
The actual PDF file data and metadata:
data
─────────────────────────────
File Name: document_with_page_numbers.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
Professional Document Formatting and Presentation
- Add page numbers to business reports, proposals, and presentations for professional formatting, document navigation, and formal presentation standards
- Process legal documents, contracts, and official records by adding page numbers for document reference, citation, and legal compliance
- Transform academic papers, research documents, and publications by adding page numbers for academic standards, citation requirements, and professional presentation
Document Management and Organization
- Add page numbers to large documents, manuals, and technical specifications for easy navigation, reference, and document organization
- Process project documentation, technical guides, and user manuals by adding page numbers for improved usability, reference, and document management
- Transform business processes, procedures, and workflows by adding page numbers for process documentation, training, and operational efficiency
Compliance and Regulatory Documentation
- Add page numbers to compliance documents, audit reports, and regulatory filings for official documentation, regulatory compliance, and audit trails
- Process financial reports, accounting documents, and audit materials by adding page numbers for financial compliance, regulatory reporting, and audit requirements
- Transform quality control documents, inspection reports, and certification materials by adding page numbers for quality management, compliance, and regulatory standards