Actions28
- Conversion Actions
- Document Actions
- PDF Service Actions
- Template Actions
- Workspace Actions
Overview
The "Add Watermark" operation of the PDF Service resource allows users to add watermarks—either text, image, or both—to existing PDF documents. This is useful for branding, copyright protection, confidentiality marking, or simply annotating PDFs with custom overlays.
Typical use cases include:
- Adding a "CONFIDENTIAL" or "DRAFT" text watermark to internal documents.
- Overlaying a company logo or seal as an image watermark on official PDFs.
- Combining text and image watermarks for enhanced document security or branding.
- Processing PDFs sourced from URLs or base64 content and outputting the watermarked PDF in various formats.
For example, a user might input a PDF URL and add a semi-transparent red "CONFIDENTIAL" text watermark centered on each page, or overlay a small logo image at the bottom right corner.
Properties
| Name | Meaning |
|---|---|
| PDF Source | Select the source of the PDF document to process: either "From URL" (a public URL to the PDF) or "From Base64" (base64 encoded PDF content). |
| PDF URL | The public URL of the PDF document to watermark (required if PDF Source is "From URL"). |
| PDF Base64 | Base64 encoded content of the PDF document to watermark (required if PDF Source is "From Base64"). |
| Output Format | Choose the output format of the watermarked PDF: - Base64 (JSON): returns JSON with base64 string - File (Binary): returns binary file data for download/attachment - URL (JSON): returns JSON with download URL |
| Watermark Type | Select one or both types of watermarks to add: - Text - Image |
| Watermark Text | The text content to use as a watermark (required if Text watermark type is selected). Default is "CONFIDENTIAL". |
| Watermark Image URL | URL to the image file to use as a watermark (required if Image watermark type is selected). |
| Text Watermark Options | Additional options for the text watermark: - Color: color of the text (default #FF0000) - Font Size: size of the text font (7 to 80, default 48) - Opacity: transparency level (0 to 1, default 0.5) - Position: location on page (e.g., center, top-left) - Rotation: angle in degrees (-180 to 180, default 0) |
| Image Watermark Options | Additional options for the image watermark: - Position: location on page (same options as text) - Rotation: angle in degrees (-180 to 180, default 0) - Scale: scale factor (0.1 to 5, default 1) |
Output
The node outputs the processed PDF document with the applied watermark(s) in the chosen format:
- Base64 (JSON): JSON object containing a base64-encoded string of the watermarked PDF.
- File (Binary): Binary data of the watermarked PDF suitable for direct download or further binary processing in n8n.
- URL (JSON): JSON object containing a URL where the watermarked PDF can be downloaded.
The output JSON includes fields such as success, operation (which will be "addWatermark"), filename (usually "processed-document.pdf"), format (output format), and fileSize (size in bytes). If binary output is selected, the binary property contains the PDF file data keyed by filename.
Dependencies
- Requires an API key credential for the external PDF Generator API service.
- The node makes authenticated HTTP requests to the PDF Generator API endpoint (default base URL:
https://us1.pdfgeneratorapi.com/api/v4). - The user must have internet access to fetch PDFs from URLs or upload base64 content.
- For image watermarks, the image URL must be publicly accessible.
Troubleshooting
- Missing required parameters: Errors occur if required inputs like PDF URL/base64, watermark text/image URL are missing when their respective watermark types are selected.
- Invalid URLs: Ensure that URLs for the PDF and watermark image start with
http://orhttps://and are publicly accessible. - Invalid base64 content: Base64 input must be valid PDF content; otherwise, the API will reject it.
- Unsupported output format: Selecting an unsupported output format may cause errors.
- API authentication errors: Verify that the API key credential is correctly configured and has necessary permissions.
- Watermark configuration errors: At least one watermark type (text or image) must be selected and properly configured.
- Network issues: Timeouts or connectivity problems when accessing URLs or the API endpoint.
To resolve these:
- Double-check all required fields based on selected options.
- Validate URLs and base64 strings before running the node.
- Confirm API credentials and network connectivity.
- Review error messages returned by the node for specific hints.
Links and References
- PDF Generator API Documentation — Official API docs for watermarking and other PDF operations.
- n8n Documentation — General guidance on using credentials and HTTP request nodes.
- Base64 Encoding Guide — Explanation of base64 encoding format.