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

The node provides functionality to digitally sign PDF documents. It supports multiple ways to input the PDF file (binary data, base64 string, or URL) and also allows specifying the signature image in various formats (binary, base64, or URL). Users can customize the placement of the signature on specified pages with options for alignment, size, margins, opacity, and layering (foreground/background). This node is useful in workflows where automated signing of PDF documents is required, such as contract approvals, official document processing, or batch signing of forms.

Practical examples:

  • Automatically signing contracts received as PDFs from an external system.
  • Adding a company logo or signature stamp to invoices before sending them out.
  • Digitally stamping certificates or reports with a signature image on specific pages.

Properties

Name Meaning
Input Data Type How the PDF file to sign is provided: Binary Data (from previous node), Base64 String, or URL to the PDF file.
Input Binary Field The binary property name containing the PDF file when using Binary Data input type.
Base64 PDF Content Base64 encoded content of the PDF document 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 signed PDF output.
Document Name Reference name for the source PDF file.
Signature Image Input Type How the signature image is provided: Binary Data (from previous node), Base64 String, or URL to the image file.
Signature Image Binary Field The binary property name containing the signature image when using Binary Data input type.
Base64 Signature Image Content Base64 encoded content of the signature image when using Base64 String input type.
Signature Image URL URL to the signature image file when using URL input type.
Image Name Filename for the signature image file.
Pages Page numbers where the signature should be added, supporting single pages, ranges, or comma-separated lists (e.g., "1", "1-3", "1,3,5").
Horizontal Alignment Horizontal alignment of the signature on the page: Left, Center, or Right.
Vertical Alignment Vertical alignment of the signature on the page: Top, Center, or Bottom.
Width (Mm) Width of the signature in millimeters (range 10-200 mm).
Height (Mm) Height of the signature in millimeters (range 10-200 mm).
Width (Px) Width of the signature in pixels (range 20-600 px).
Height (Px) Height of the signature in pixels (range 20-600 px).
Horizontal Margin (Mm) Horizontal margin from the aligned edge in millimeters (range 0-100 mm).
Vertical Margin (Mm) Vertical margin from the aligned edge in millimeters (range 0-100 mm).
Horizontal Margin (Px) Horizontal margin from the aligned edge in pixels (range 0-300 px).
Vertical Margin (Px) Vertical margin from the aligned edge in pixels (range 0-300 px).
Opacity Opacity level of the signature image (0 = invisible, 100 = fully opaque).
Show Only in Print Boolean flag indicating whether the signature should only appear in print view or also on screen.
Background Signature Boolean flag indicating if the signature should be placed in the background behind other content.
Advanced Options Collection for additional custom JSON profiles to adjust extra API call properties (e.g., output format).
Binary Data Output Name Custom name for the binary data field in the node's output containing the signed PDF.

Output

The node outputs the signed PDF document as binary data under a configurable binary property name (default is "data"). The output includes the signed PDF file ready for further use or storage. The output JSON may also contain metadata about the operation or errors if any occurred during execution.

If the input was binary, the output will be binary data representing the signed PDF. If the input was base64 or URL, the output similarly contains the signed PDF in binary form for downstream nodes.

Dependencies

  • Requires access to an external PDF processing service or API capable of signing PDFs with images.
  • Needs proper authentication credentials (such as an API key or token) configured in n8n to interact with the PDF signing service.
  • Network access to fetch PDF files or signature images if URLs are used as inputs.

Troubleshooting

  • Common issues:

    • Incorrect input data type or missing binary fields can cause failures in reading the PDF or signature image.
    • Invalid page number formats or pages outside the range of the PDF may result in no signature being applied.
    • Network errors when fetching PDFs or images from URLs.
    • Insufficient permissions or invalid API credentials causing authorization errors.
  • Error messages and resolutions:

    • "Input binary property not found": Verify that the specified binary property name exists in the incoming data.
    • "Invalid base64 content": Ensure the base64 string is correctly encoded without extra characters.
    • "Failed to fetch URL": Check network connectivity and URL correctness.
    • "Signature placement error": Confirm page numbers and alignment settings are valid.
    • Authentication errors: Recheck API credentials and permissions.

Links and References

Discussion