CraftMyPdf icon

CraftMyPdf

Consume the CraftMyPDF API

Actions7

Overview

The node integrates with the CraftMyPDF API to add a watermark to an existing PDF document. It allows users to specify the source PDF by URL and customize the watermark's appearance, including text, font, size, color, opacity, rotation, and output file name. This operation is useful for branding PDFs, marking documents as confidential or draft, or adding any custom text overlay to PDF files.

Practical examples:

  • Adding a "Confidential" watermark diagonally across all pages of a PDF report.
  • Branding invoices or contracts with a company name or logo text.
  • Marking drafts or reviewed versions of documents with visible watermarks.

Properties

Name Meaning
Region The API endpoint region to use. Options include Default, Australia, Europe (Frankfurt), US East, Alternative endpoints, and Staging.
Expiration Time in minutes before the generated PDF expires (1 to 10080 minutes).
Output File The filename for the resulting watermarked PDF file.
URL The URL of the source PDF document to which the watermark will be added.
Watermark Text The text string to use as the watermark on the PDF.
Font Size The font size of the watermark text (default 40).
Opacity The transparency level of the watermark (0 to 1, default 0.5).
Rotation The rotation angle in degrees for the watermark text (default 45).
Hex Color The color of the watermark text specified as a hex color code (default #c7c7c7).
Font Family The font family for the watermark text. Options include Courier variants, Helvetica variants, Symbol, Times variants, and ZapfDingbats.

Output

The node outputs JSON data representing the result of the watermark operation. When the output type is a file, it returns the watermarked PDF file content ready for further use or download. The main output field json contains metadata about the processed PDF, such as URLs or status messages from the API.

If binary data is returned (e.g., the actual PDF file), it represents the watermarked PDF document that can be saved or passed to subsequent nodes.

Dependencies

  • Requires an active connection to the CraftMyPDF API via an API key credential configured in n8n.
  • Network access to the source PDF URL must be available.
  • Proper configuration of the selected API region endpoint is necessary to route requests correctly.

Troubleshooting

  • Invalid JSON Data: If the input JSON data for other operations is malformed, the node throws an error. For watermarking, ensure the URL and text fields are valid strings.
  • API Authentication Errors: Missing or invalid API credentials will cause authentication failures. Verify the API key is correctly set up.
  • Source PDF Access Issues: If the provided URL is inaccessible or invalid, the API call will fail. Confirm the URL is reachable and points to a valid PDF.
  • Parameter Validation: Ensure numeric parameters like expiration, font size, opacity, and rotation are within allowed ranges.
  • Output File Naming: Avoid using invalid characters in the output file name to prevent file handling errors.

Links and References

Discussion