Skip to main content

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:

  1. Add PDF4me node to workflow
  2. Select "Add Page Number to PDF" action
  3. Configure input parameters (see below)
Add Page Number to PDF

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.

ParameterTypeDescriptionExample
Input Data Type***StringPDF 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 FieldBinaryBinary 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 ContentStringBase64 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 URLStringPublic 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***StringEnhanced 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***StringSource PDF Reference
• Specify the name of the source PDF file
• For reference and tracking purposes
• Helps with processing tracking
document.pdf
Horizontal Alignment***StringHorizontal Page Number Alignment
• Choose horizontal positioning of page numbers
• Options: Left, Center, Right
• PDF4me ensures precise alignment
• Essential for professional presentation
Right
Vertical Alignment***StringVertical 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)***NumberHorizontal 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)***NumberVertical 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***NumberPage 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***BooleanBold Text Formatting
• Apply bold formatting to page number text
• Enhanced visibility and professional presentation
• Creates prominent page numbers
• Default is false
false
Set Italic***BooleanItalic 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***BooleanFirst 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***StringBinary 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:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom 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

ParameterTypeDescriptionExample
fileNameStringPDF4me 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 processesdocument_with_page_numbers.pdf
fileSizeNumberPDF4me 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 automation125430
successBooleanPDF4me 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 workflowstrue
mimeTypeStringPDF4me 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 applicationsapplication/pdf
pageCountNumberPDF4me processed page count - Number of pages that were processed with page numbers. Provides verification of successful page processing and helps track document enhancement progress5
messageStringPDF4me page numbering status message - Human-readable status message providing details about the page number addition process result. Includes success confirmation or error details for troubleshootingPage 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 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
}
]

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

Get Help