PDF watermark
Watermark is an API that overlays text (e.g. "CONFIDENTIAL" or "DRAFT") or your logo onto a PDF. Great for protecting documents or branding them from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF plus either text or an image (your logo), and get back the same PDF with the watermark overlaid on every page (or just the ones you pick). By default it's diagonal, centered and semi-transparent. Nothing is stored.
Only one at a time: text OR image, not both in the same call.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
Text watermark: how to use it in n8n
The simplest way: send your PDF as is (as binary data) and the text as a parameter. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-watermark - Send Query Parameters: on, and add
text=CONFIDENTIAL(and whatever you want:opacity,position… see the table). - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/pdf - Send Body: on → choose the binary file option (in n8n: "n8n Binary File", with your PDF's binary property, usually
data) - Under Options → Response → Response Format: choose File
In Make: same method and URL, add text to Query String, the two headers in Headers, and the PDF as binary data in the body.
Watermarking with your logo
To use an image instead of text, you need to send two files at once (the PDF and the logo), so this variant only works with a JSON body, not a binary "Send Body":
{ "file": "<your PDF in base64>", "image": "<your logo in base64, PNG or JPEG>" }
In n8n, convert them to base64 with a Code node using {{'{{'}}$binary.data.toString('base64'){{'}}'}} for each one, and paste them into the JSON Body (Body Content Type: JSON).
Options (as Query Parameters or in the JSON)
| Option | Default | What it does |
|---|---|---|
text | - | The watermark text (max 200 characters). Use this OR image, not both. |
image | - | Your logo in base64 (PNG or JPEG). JSON body only. |
position | center | center, top-left, top-right, bottom-left or bottom-right. |
opacity | 0.3 | Transparency, from 0.05 (almost invisible) to 1 (opaque). |
rotation | 45 | Rotation in degrees (0 = no rotation). |
pages | all | Which pages to mark, e.g. 1-3,5. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-watermark - Auth: header
x-api-key: YOUR_KEY. - Input: text → raw
application/pdf(withtextas a Query param) or JSON with{ file, text, ... }. Image → JSON ONLY,{ file, image, ... }(two binaries don't fit in a raw body). - Output: by default, with
application/pdfit returns the binary; with JSON it returns base64 inpdf. Addoutput=pdforoutput=jsonto force it. - Rotation: here
rotationaccepts any angle (not just multiples of 90) because it draws rotated content, unlike /pdf-rotate, which changes the page's own orientation. - Limits: input PDF up to 20 MB (50 MB on Business/Scale) in
application/pdfmode, or ~4 MB real in JSON with base64. 30 requests/min per IP. 1 watermark = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
text | - | Watermark text (max 200 chars). Exactly one of text/image. |
image | - | Base64 of a PNG or JPEG image. JSON mode only. |
position | center | center, top-left, top-right, bottom-left, bottom-right. |
opacity | 0.3 | 0.05–1. |
rotation | 45 | Degrees, any value. |
font_size | 48 | 8–200. Applies to text only. |
color | #808080 | Hex. Applies to text only. |
scale | 0.3 | 0.05–1, fraction of page width. Applies to image only. |
pages | all | 1-indexed range, e.g. 1-3,5. |
file | - | JSON mode only: the PDF in base64. |
output | per mode | pdf (binary) or json (base64). |
Examples
curl (text watermark, raw PDF):
curl -X POST "https://api.cofferdock.com/pdf-watermark?text=CONFIDENTIAL&opacity=0.25" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
-o watermarked.pdf
JavaScript (Node 18+, logo watermark):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/pdf-watermark', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
file: fs.readFileSync('document.pdf').toString('base64'),
image: fs.readFileSync('logo.png').toString('base64'),
position: 'bottom-right', scale: 0.15, opacity: 0.6, rotation: 0,
output: 'binary',
}),
});
fs.writeFileSync('watermarked.pdf', Buffer.from(await r.arrayBuffer()));
Python (text watermark):
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-watermark',
params={'text': 'CONFIDENTIAL', 'opacity': 0.25},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
open('watermarked.pdf', 'wb').write(r.content)
JSON mode (base64 response)
{ "file": "JVBERi0xLjQ…", "text": "DRAFT", "position": "center" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_watermarked": 4, "type": "text", "total_pages": 4, "used": 12, "remaining": 488 } }
What you get back
The watermarked PDF itself, ready to save or send. (In JSON mode, the PDF comes in base64.)