Marca de agua en PDF
Marca de agua es una API que superpone un texto (ej. "CONFIDENCIAL" o "BORRADOR") o tu logo sobre un PDF. Perfecto para proteger documentos o marcarlos con tu marca desde n8n, Make o Zapier, sin montar servidores.
Cómo funciona
Le mandas un PDF y, o bien un texto, o bien una imagen (tu logo), y te devuelve el mismo PDF con la marca superpuesta en todas las páginas (o solo las que elijas). Por defecto sale en diagonal, centrada y semitransparente. No guarda nada.
Solo uno de los dos a la vez: texto O imagen, no ambos en la misma llamada.
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
Marca de agua de texto: cómo usarlo en n8n
La forma más sencilla: le envías tu PDF tal cual (como archivo binario) y el texto como parámetro. En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-watermark - Send Query Parameters: actívalo y añade
text=CONFIDENCIAL(y lo que quieras:opacity,position… ver la tabla). - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type=application/pdf - Send Body: actívalo → elige la opción para mandar un archivo binario (en n8n: "n8n Binary File", con la propiedad binaria de tu PDF, normalmente
data) - En Options → Response → Response Format: elige File
En Make: mismo método y URL, en Query String añade text, en Headers las dos cabeceras, y el PDF como dato binario en el cuerpo.
Marca de agua de tu logo
Para usar una imagen en vez de texto, hace falta mandar dos archivos a la vez (el PDF y el logo), así que esta variante solo funciona con el cuerpo en JSON, no con "Send Body" binario:
{ "file": "<tu PDF en base64>", "image": "<tu logo en base64, PNG o JPEG>" }
En n8n, conviértelos a base64 con un nodo Code y la expresión {{'{{'}}$binary.data.toString('base64'){{'}}'}} para cada uno, y pégalos en el JSON del Body (Body Content Type: JSON).
Opciones (en Query Parameters o en el JSON)
| Opción | Por defecto | Para qué sirve |
|---|---|---|
text | — | El texto de la marca de agua (máx. 200 caracteres). Usa esta O image, no ambas. |
image | — | Tu logo en base64 (PNG o JPEG). Solo con cuerpo JSON. |
position | center | center, top-left, top-right, bottom-left o bottom-right. |
opacity | 0.3 | Transparencia, de 0.05 (casi invisible) a 1 (opaca). |
rotation | 45 | Grados de giro (0 = sin girar). |
pages | todas | Qué páginas marcar, ej. 1-3,5. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/pdf-watermark - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: texto →
application/pdfa pelo (contexten Query) o JSON con{ file, text, ... }. Imagen → SOLO JSON,{ file, image, ... }(dos binarios no caben en un cuerpo crudo). - Salida: por defecto, con
application/pdfdevuelve el binario; con JSON devuelve base64 enpdf. Añadeoutput=pdfooutput=jsonpara forzarlo. - Rotación: aquí
rotationadmite cualquier ángulo (no solo múltiplos de 90) porque dibuja contenido girado, no cambia la orientación de la página como /pdf-rotate. - Límites: PDF de entrada hasta 20 MB (50 MB en Business/Scale) en modo
application/pdf, o ~4 MB reales en JSON con base64. 30 peticiones/min por IP. 1 marca de agua = 1 crédito.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
text | — | Texto de la marca (máx. 200 car.). Exactamente uno de text/image. |
image | — | Base64 de una imagen PNG o JPEG. Solo en modo JSON. |
position | center | center, top-left, top-right, bottom-left, bottom-right. |
opacity | 0.3 | 0.05–1. |
rotation | 45 | Grados, cualquier valor. |
font_size | 48 | 8–200. Solo aplica a text. |
color | #808080 | Hex. Solo aplica a text. |
scale | 0.3 | 0.05–1, fracción del ancho de página. Solo aplica a image. |
pages | todas | Rango 1-indexado, ej. 1-3,5. |
file | — | Solo en modo JSON: el PDF en base64. |
output | según modo | pdf (binario) o json (base64). |
Ejemplos
curl (marca de texto, PDF a pelo):
curl -X POST "https://api.cofferdock.com/pdf-watermark?text=CONFIDENCIAL&opacity=0.25" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/pdf" \
--data-binary @documento.pdf \
-o marcado.pdf
JavaScript (Node 18+, marca de logo):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/pdf-watermark', {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json' },
body: JSON.stringify({
file: fs.readFileSync('documento.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('marcado.pdf', Buffer.from(await r.arrayBuffer()));
Python (marca de texto):
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-watermark',
params={'text': 'CONFIDENCIAL', 'opacity': 0.25},
headers={'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/pdf'},
data=open('documento.pdf', 'rb').read(),
)
open('marcado.pdf', 'wb').write(r.content)
Modo JSON (respuesta en base64)
{ "file": "JVBERi0xLjQ…", "text": "BORRADOR", "position": "center" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_watermarked": 4, "type": "text", "total_pages": 4, "used": 12, "remaining": 488 } }
Lo que recibes
El PDF marcado directamente, listo para guardar o enviar. (En modo JSON, el PDF llega en base64.)
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.)