PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

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 node is beneficial in scenarios where automated document processing workflows require pagination for easier navigation, referencing, or compliance with formatting standards. For example, adding page numbers to reports generated dynamically, legal documents, or multi-page invoices before sending them out.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file: "Binary Data" (from previous node), "Base64 String" (direct content), or "URL" (link to 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 content (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 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 page numbers on the page: Left, Center, or Right.
Vertical Alignment Vertical position of page numbers on the page: Top, Middle, or Bottom.
Horizontal Margin (Mm) Horizontal margin in millimeters (0-100) from the chosen alignment edge.
Vertical Margin (Mm) Vertical margin in millimeters (0-100) from the chosen alignment edge.
Font Size Font size for the page numbering text, ranging from 8 to 72 points.
Set Bold Whether the page number text should be bold.
Set Italic Whether the page number text should be italicized.
Skip First Page Option to skip adding page numbers on the first page of the document.
Advanced Options Custom JSON profiles to adjust extra API call properties for advanced use cases.
Binary Data Output Name Custom name for the binary data field in the node's output containing the resulting PDF.

Output

The node outputs the processed PDF file with page numbers added as binary data. The binary data field name can be customized via the "Binary Data Output Name" property (default is "data"). The output contains the PDF file ready for further use or download within the workflow.

The json output typically includes metadata about the operation or references to the binary data but primarily serves to carry the binary PDF content.

Dependencies

  • Requires access to an external PDF processing service or API capable of adding page numbers to PDFs.
  • Needs proper API authentication configured in n8n credentials (e.g., an API key or token).
  • Network access is required if the input PDF is provided via URL or if the service is cloud-based.

Troubleshooting

  • Common Issues:

    • Invalid or inaccessible PDF URL: Ensure the URL is publicly accessible or reachable by the node.
    • Incorrect binary property name: Verify that the binary field name matches the actual input binary data property.
    • 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 to avoid errors.
  • Error Messages:

    • Errors related to missing or invalid input data usually indicate misconfiguration of input properties.
    • Authentication failures suggest incorrect or missing API credentials.
    • API response errors may occur if the PDF is corrupted or unsupported.

Resolving these typically involves verifying input data correctness, ensuring valid credentials, and checking network connectivity.

Links and References

  • PDF4me API Documentation — for advanced profile options and API capabilities.
  • General PDF manipulation best practices and guidelines for page numbering.

Discussion