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 "Sign PDF" allows users to digitally add a signature image onto one or more pages of a PDF document. It supports multiple input methods for both the PDF file and the signature image, including binary data from previous nodes, base64 encoded strings, or URLs pointing to the files. Users can customize the placement, size, opacity, and visibility of the signature on specified pages.

Common scenarios include:

  • Automating the signing of contracts, agreements, or official documents within an automated workflow.
  • Adding a visual signature stamp to PDFs before sending them out or archiving.
  • Batch processing multiple PDFs to apply consistent signatures.

Practical example:
A user receives unsigned PDF contracts via email, extracts them into n8n, and uses this node to place a company signature image on the first page before forwarding the signed contract to clients.

Properties

Name Meaning
Input Data Type How to provide the PDF file to sign:
- Binary Data (from previous node)
- Base64 String (encoded PDF content)
- 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 sign (used if Input Data Type is URL)
Output File Name Desired filename for the output signed PDF file
Document Name Name of the source PDF file for reference purposes
Signature Image Input Type How to provide the signature image:
- Binary Data (from previous node)
- Base64 String (encoded image content)
- URL (link to signature image file)
Signature Image Binary Field Name of the binary property containing the signature image (used if Signature Image Input Type is Binary Data)
Base64 Signature Image Content Base64 encoded string of the signature image content (used if Signature Image Input Type is Base64 String)
Signature Image URL URL to the signature image file (used if Signature Image Input Type is URL)
Image Name Filename for the signature image file
Pages Page numbers where the signature should be added. Supports formats like "1", "1-3", "1,3,5"
Horizontal Alignment Horizontal alignment of the signature on the page: Left, Center, Right
Vertical Alignment Vertical alignment of the signature on the page: Top, Center, Bottom
Width (Mm) Signature width in millimeters (range 10-200)
Height (Mm) Signature height in millimeters (range 10-200)
Width (Px) Signature width in pixels (range 20-600)
Height (Px) Signature height in pixels (range 20-600)
Horizontal Margin (Mm) Horizontal margin in millimeters (range 0-100)
Vertical Margin (Mm) Vertical margin in millimeters (range 0-100)
Horizontal Margin (Px) Horizontal margin in pixels (range 0-300)
Vertical Margin (Px) Vertical margin in pixels (range 0-300)
Opacity Opacity level of the signature image (0 = invisible, 100 = fully opaque)
Show Only in Print Boolean flag whether the signature should only appear when printing (true) or also visible on screen (false)
Background Signature Boolean flag whether to place the signature behind existing content (true) or on top (false)
Advanced Options Collection for additional custom JSON profiles to adjust API call properties, allowing advanced customization of the signing process

Output

The node outputs the signed PDF document as binary data under the specified output file name. The output JSON contains metadata about the signed file, typically including the filename and binary data reference. This allows subsequent nodes to use or store the signed PDF.

If the input was binary, the output will be binary data representing the signed PDF. If base64 or URL inputs were used, the output remains consistent as a signed PDF binary file.

Dependencies

  • Requires access to an external PDF processing service or API capable of applying image signatures to PDF files.
  • Needs proper authentication credentials (e.g., an API key or token) configured in n8n to authorize requests to the PDF signing service.
  • Network access to fetch PDF or signature images if URLs are provided.
  • The node depends on internal action modules that handle the actual signing logic, which interface with the external PDF service.

Troubleshooting

  • Common issues:

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

    • "Input binary property not found": Verify the binary field name matches the previous node's output.
    • "Invalid base64 content": Ensure the base64 string is correctly encoded without extra characters.
    • "Page number out of range": Check the pages parameter to ensure it references valid pages in the PDF.
    • "Failed to fetch URL": Confirm the URL is accessible and correct.
    • "Authentication failed": Recheck API credentials and permissions in n8n settings.

Links and References

Discussion