Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Split PDF By Barcode
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Split PDF By Swiss QR
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
This node operation "Add Page Number To PDF" allows users to add page numbers to an existing PDF document. It supports multiple input methods for the source PDF, including binary data from a previous node, a base64 encoded string, or a URL pointing to the PDF file. Users can customize the appearance and positioning of the page numbers, such as alignment, margins, font size, and style (bold/italic). There is also an option to skip numbering on the first page.
This functionality is useful in scenarios where you need to paginate reports, contracts, invoices, or any multipage PDF documents automatically within an automation workflow. For example, adding page numbers to a batch of generated PDFs before sending them out or archiving.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Method to provide the PDF file: "Binary Data" (from previous node), "Base64 String" (base64 encoded PDF content), or "URL" (link to PDF file). |
| Input Binary Field | The name of the binary property containing the PDF file when using "Binary Data" input type. |
| Base64 PDF Content | Base64 encoded string of the PDF document content when using "Base64 String" input type. |
| PDF URL | URL to the PDF file when using "URL" input type. |
| Output File Name | Desired filename for the output PDF with page numbers added. |
| Document Name | Name of the source PDF file for reference purposes. |
| Horizontal Alignment | Horizontal position of the page number on the page: Left, Center, or Right. |
| Vertical Alignment | Vertical position of the page number on the page: Top, Middle, or Bottom. |
| Horizontal Margin (Mm) | Horizontal margin in millimeters (0-100) from the edge of the page for the page number placement. |
| Vertical Margin (Mm) | Vertical margin in millimeters (0-100) from the edge of the page for the page number placement. |
| Font Size | Font size for the page numbering text, ranging from 8 to 72 points. |
| Set Bold | Boolean flag to set the page numbering text in bold. |
| Set Italic | Boolean flag to set the page numbering text in italic. |
| Skip First Page | Boolean flag to skip adding page number on the first page of the document. |
| Advanced Options | JSON string to specify custom profiles or additional API options for advanced customization. |
| Binary Data Output Name | Custom name for the binary data field in the node's output containing the resulting PDF file. |
Output
The node outputs the modified PDF document with page numbers added as binary data. The binary data field name can be customized via the "Binary Data Output Name" property. The output contains the PDF file ready for further processing or saving.
The json output typically includes metadata about the processed file, but the main content is the binary PDF data representing the paginated document.
Dependencies
- Requires access to an external PDF processing service or API capable of adding page numbers to PDF files.
- Needs appropriate API credentials or authentication tokens configured in n8n to interact with the PDF service.
- Network access is required if providing the PDF via URL or if the service is cloud-based.
Troubleshooting
Common issues:
- Invalid or inaccessible PDF URL leading to failure in fetching the source document.
- Incorrect binary property name causing the node to not find the input PDF data.
- Malformed base64 string input causing decoding errors.
- Exceeding allowed font size or margin values outside specified ranges.
- Missing or invalid API credentials preventing successful API calls.
Error messages and resolutions:
- "Input PDF not found" — Verify the binary property name or input data source.
- "Failed to fetch PDF from URL" — Check the URL accessibility and correctness.
- "Invalid base64 content" — Ensure the base64 string is properly encoded without extra characters.
- "API authentication failed" — Confirm that the API key or token is correctly configured in n8n credentials.
- "Parameter out of range" — Adjust font size or margin values within allowed limits.
Links and References
- PDF4me API Documentation — Reference for advanced profile options and API capabilities related to PDF manipulation.