Add Watermark
add_watermarkOverlay diagonal watermarks like DRAFT or COPY across PDF pages to clearly indicate document status, while preserving tagged PDF/UA compliance and content readability.
Instructions
Overlay a diagonal watermark across the middle of each page ("社外秘" / "DRAFT" / "COPY", etc.). Drawn faintly behind the content by default. In tagged PDFs it is wrapped as an Artifact, preserving PDF/UA conformance. CJK watermarks need fontPath or the PDF_WRITER_FONT environment variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Watermark text, e.g. "社外秘" / "DRAFT" / "COPY". | |
| angle | No | Counter-clockwise angle (degrees). Default 45. 0 = horizontal. | |
| color | No | #rrggbb. Default #808080 (grey). | |
| pages | No | Target pages, "1,3-5,8-" (1-based). All when omitted. | |
| behind | No | Draw behind the content. Default true. false draws over it (to strengthen the tamper-deterrent claim). | |
| opacity | No | Opacity, 0 (transparent) to 1 (opaque). Default 0.15 — faint enough to keep the content readable. | |
| fontPath | No | Font to embed (.ttf/.otf). Falls back to the PDF_WRITER_FONT environment variable, then the standard font. Required for CJK watermarks. | |
| fontSize | No | Font size (pt). Default 60. Range 4-96. | |
| inputPath | Yes | Absolute path of the target PDF. | |
| outputPath | No | Destination file path (absolute). When omitted, a base64 string is returned instead. | |
| returnBase64 | No | When true, include a base64 string in the result in addition to saving. | |
| preserveSignatures | No | Edit a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. Changes beyond the certification (DocMDP) permission level are refused. | |
| allowBreakingSignatures | No | When the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid. |