add_watermark
Stamp a text or image watermark on every PDF page. Control placement, rotation, and opacity to protect or brand documents.
Instructions
Stamp a text or image watermark onto every page of a PDF. For mode="text", provide text. For mode="image", provide image_file (.jpg/.jpeg/.png). Tune placement, rotation, and opacity as needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | "text" stamps a text watermark; "image" stamps an image file onto each page. | |
| text | No | Text to stamp. Required when mode="text". | |
| layer | No | Whether the watermark sits above the page content or behind it. | above |
| opacity | No | Opacity percentage (1-100). Default: 100. | |
| rotation | No | Rotation in degrees (0-360). Default: 0. | |
| image_file | No | Path to a .jpg/.jpeg/.png image to stamp. Required when mode="image". | |
| input_file | Yes | Path to the PDF file to watermark. | |
| output_path | No | Optional output path. If it ends with the expected extension, the file is written there. If it is a directory, the file is placed inside with a timestamped name. Defaults to the same directory as the first input. | |
| vertical_position | No | middle | |
| horizontal_position | No | center |