Actions80
- Extract Text From Word
- Find And Replace Text
- Convert PDF To Editable PDF Using OCR
- Create Swiss QR Bill
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Create PDF/A
- Convert HTML To PDF
- Convert Markdown To PDF
- Upload File To PDF4me
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Fill PDF Form
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- AI-Invoice Parser
- AI-Process HealthCard
- AI-Process Contract
- Generate Barcode
- Classify Document
- Parse Document
- Linearize PDF
- Flatten PDF
- Convert To PDF
- Json To Excel
- Convert PDF To Excel
- Convert PDF To Word
- Convert PDF To PowerPoint
- Convert VISIO
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Extract Pages
- Merge Multiple PDFs
- Overlay PDFs
- Rotate Document
- Rotate Page
- Sign PDF
- URL to PDF
- Add Image Watermark To Image
- Add Text Watermark To Image
- Compress Image
- Convert Image Format
- Create Images From PDF
- Flip Image
- Get Image Metadata
- Image Extract Text
- Remove EXIF Tags From Image
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Image
- Rotate Image By EXIF Data
- Compress PDF
- Get PDF Metadata
- Repair PDF Document
- Get Document From Pdf4me
- Update Hyperlinks Annotation
- Protect Document
- Unlock PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Generate Document Single
- Generate Documents Multiple
- Get Tracking Changes In Word
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Attachment From PDF
- Extract Text By Expression
- Extract Table From PDF
- Extract Resources
Overview
This node operation adds page numbers to a PDF document. It is useful when you need to paginate existing PDF files for easier navigation, referencing, or printing purposes. Common scenarios include preparing reports, contracts, or multi-page documents where page numbering is required.
The node supports multiple input methods for the source PDF: binary data from a previous node, a base64 encoded string, or a URL pointing to the PDF file. Users can customize the appearance and placement of the page numbers, including font size, style (bold/italic), alignment, margins, and whether to skip numbering on the first page.
Practical examples:
- Adding page numbers to a scanned contract PDF fetched via URL before sending it out.
- Numbering pages in a dynamically generated PDF received as base64 content.
- Processing PDFs uploaded in a workflow and adding page numbers aligned at the bottom-right corner with custom margins.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Choose how to provide the PDF file: "Binary Data" (from previous node), "Base64 String" (base64 encoded PDF content), or "URL" (link to the PDF file). |
| Input Binary Field | Name of the binary property containing the PDF file (used if Input Data Type is "Binary Data"). |
| Base64 PDF Content | Base64 encoded string of the PDF document (used if Input Data Type is "Base64 String"). |
| PDF URL | URL to the PDF file to add page numbers to (used if Input Data Type is "URL"). |
| Output File Name | Desired name for the output PDF file with page numbers added. |
| Document Name | Name of the source PDF file for reference purposes. |
| Horizontal Alignment | Horizontal position of the page numbers on the page: Left, Center, or Right. |
| Vertical Alignment | Vertical position of the page numbers on the page: Top, Middle, or Bottom. |
| Horizontal Margin (Mm) | Horizontal margin in millimeters (0-100) from the chosen horizontal alignment edge. |
| Vertical Margin (Mm) | Vertical margin in millimeters (0-100) from the chosen vertical alignment edge. |
| Font Size | Font size for the page numbering text, ranging from 8 to 72 points. |
| Set Bold | Whether the page numbering text should be bold. |
| Set Italic | Whether the page numbering text should be italicized. |
| Skip First Page | Option to skip numbering on the first page of the document. |
| Advanced Options | Custom JSON profiles to adjust extra properties for the API call, allowing advanced customization beyond standard options. |
Output
The node outputs the processed PDF file with page numbers added. The output is typically provided as binary data representing the new PDF document. The output includes:
- A JSON field containing metadata or references.
- The binary data of the updated PDF file, which can be saved or passed to subsequent nodes.
If the input was binary or base64, the output will be binary data representing the modified PDF. If the input was a URL, the output similarly contains the updated PDF content.
Dependencies
- Requires access to an external PDF processing service or API capable of adding page numbers to PDF documents.
- Needs proper API authentication configured in n8n (e.g., an API key credential).
- Internet access may be necessary if using the URL input option to fetch the PDF.
Troubleshooting
Common Issues:
- Invalid or inaccessible PDF URL: Ensure the URL is reachable and points directly to a valid PDF file.
- Incorrect binary property name: Verify that the binary field name matches the actual property containing the PDF data.
- Malformed base64 content: Confirm the base64 string is correctly encoded and complete.
- Font size or margin values out of allowed range: Use values within specified limits (font size 8-72, margins 0-100 mm).
Error Messages:
- Errors related to fetching the PDF from URL usually indicate network issues or invalid URLs.
- API errors might occur if authentication credentials are missing or incorrect.
- Validation errors if input parameters are outside allowed ranges or missing required fields.
Resolutions:
- Double-check all input parameters and ensure they conform to expected formats.
- Validate connectivity and permissions for URL-based inputs.
- Configure and verify API credentials in n8n settings.
- Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.
Links and References
- PDF4me API Documentation — For advanced profile options and additional API capabilities.
- n8n Documentation on Working with Binary Data
- General information on Base64 Encoding