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 operation "Add Image Stamp To PDF" allows users to add an image stamp onto a PDF document. This is useful for scenarios such as watermarking documents, adding logos, signatures, or any custom image overlays on specific pages of a PDF. For example, a company might use this node to automatically stamp their logo on all pages of a contract PDF before sending it out, or to add a signature image on certain pages of an invoice.

Properties

Name Meaning
Input Data Type How the source PDF file is provided: Binary Data (from previous node), Base64 encoded 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 input type.
PDF URL URL to the PDF file when using URL input type.
Output File Name The filename for the resulting PDF with the image stamp applied.
Document Name The name of the source PDF file for reference purposes.
Image Input Data Type How the image for the stamp is provided: Base64 string, Binary Data (from previous node), or URL to the image file.
Image Binary Field The binary property name containing the image file when using Binary Data input type for the image.
Base64 Image Content Base64 encoded image content for the stamp when using Base64 input type.
Image URL URL to the image file for the stamp when using URL input type.
Image Name The filename of the image stamp including extension (.png or .jpeg).
Pages Comma-separated list or ranges of page indices to apply the image stamp to (e.g., "0,1,2-" or "1,2,3-7"). If not specified, all pages are processed.
Horizontal Alignment Horizontal alignment of the image stamp on the page: Left, Center, or Right.
Vertical Alignment Vertical alignment of the image stamp on the page: Top, Middle, or Bottom.
Height (Mm) Height of the image stamp in millimeters. If set to 0, default height or aspect ratio-based height is used.
Width (Mm) Width of the image stamp in millimeters. If set to 0, default width or aspect ratio-based width is used.
Height (Px) Height of the image stamp in points (pixels). Example: 40pt.
Width (Px) Width of the image stamp in points (pixels). Example: 40pt.
Horizontal Margin (Mm) Horizontal margin in millimeters from the page edge depending on horizontal alignment. Ignored if alignment is Center.
Vertical Margin (Mm) Vertical margin in millimeters from the page edge depending on vertical alignment. Ignored if alignment is Middle.
Horizontal Margin (Px) Margin from left origin of the image stamp in pixels.
Vertical Margin (Px) Margin from top origin of the image stamp in pixels.
Opacity Opacity level of the image stamp from 0 (fully transparent) to 100 (fully opaque).
Background Stamp Boolean indicating whether the image should be used as a background stamp (true) or foreground (false).
Show Only in Print Boolean indicating whether the stamp should only be visible when printing (true) or always visible (false).
Advanced Options Collection of advanced options including:
- Custom Profiles: JSON string to adjust extra API call properties.
- Enable Debug Mode: boolean to enable debugging and logging.
Binary Data Output Name Custom name for the binary data output property in n8n.

Output

The node outputs the modified PDF document with the image stamp applied. The output contains a binary data field (default named "data" or custom named by user) which holds the stamped PDF file. This binary data can be used downstream in workflows for saving, emailing, or further processing.

Dependencies

  • Requires access to the PDF processing service/API that performs the image stamping.
  • Needs proper authentication via an API key or token configured in n8n credentials (generic API key credential).
  • Internet access may be required if URLs are used for input PDF or image files.

Troubleshooting

  • Common Issues:
    • Incorrect input data type or missing binary fields can cause failures.
    • Invalid base64 strings or inaccessible URLs will result in errors.
    • Specifying invalid page ranges or formats may lead to no stamping or errors.
    • Using unsupported image formats or incorrect image names/extensions could cause processing issues.
  • Error Messages:
    • Errors related to "file not found" or "invalid input" usually indicate problems with input data provision.
    • Authentication errors suggest missing or invalid API credentials.
    • Debug mode can be enabled via advanced options to get detailed logs for troubleshooting.

Links and References

Discussion