Add a watermark
add_watermarkStamps large, semi-transparent, rotated text like CONFIDENTIAL or DRAFT across selected PDF pages and saves the result as a new file, leaving the original unchanged.
Instructions
Writes a large, semi-transparent, rotated text (e.g. CONFIDENTIAL, DRAFT) across the middle of every page or the chosen pages of a PDF and saves the result as a new PDF; the page content stays readable underneath. For small text in a corner or a footer, use add_page_numbers. The original is not changed, and an existing output file is only replaced with overwrite: true. Encrypted PDFs cannot be saved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the PDF. | |
| text | Yes | Watermark text. | |
| angle | No | Rotation in degrees; negative values rise to the right (default -45). | |
| color | No | Text colour (default red), as #rrggbb. | |
| pages | No | Pages as 1-based numbers and ranges, e.g. "1-3,5". All pages when omitted; a page outside the document is an error. | |
| output | Yes | Absolute path of the new PDF. If the file exists, the call fails unless overwrite is true. | |
| opacity | No | 0.05 to 1 (default 0.2). | |
| password | No | Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it. | |
| font_size | No | Default 64. | |
| overwrite | No | Allow replacing an existing file (default false). |