PDF watermark
Try it interactively →POST /api/pdf-watermarkStamp a text watermark across every page of a PDF. Configurable text, font size, opacity, rotation, and colour. Preserves the original document content.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| pdf* | file | — | The PDF to watermark. |
| text* | string | — | Watermark text (1.200 chars). |
| position | enum (top-left | top-center | top-right | center-left | center | center-right | bottom-left | bottom-center | bottom-right | diagonal) | "diagonal" | Where to place the text. |
| fontSize | number (6…256) | 48 | Font size in points. |
| opacity | number (0…1) | 0.25 | Watermark opacity (0.1). |
| color | string | "gray" | '#rrggbb' or one of black/white/red/blue/gray/green. |
| bold | boolean | true | Use Helvetica-Bold (true) or Helvetica (false). |
Response
Modes: binary, base64-json. Cache: yes (24h TTL).
Code samples
Built from the draft-diagonal example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/pdf-extract-text/hello.pdf
PDF=$(base64 -w0 < hello.pdf)
curl -X POST https://api.xtract.bot/api/pdf-watermark \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"text": "DRAFT",
"position": "diagonal",
"fontSize": 64,
"opacity": 0.25,
"color": "gray",
"bold": true,
"pdf": "'"$PDF"'"
}'