Números de página en PDF
Números de página es una API que añade la numeración a un PDF que no la tiene. Perfecto para informes, contratos o dosieres generados desde n8n, Make o Zapier, sin montar servidores.
Cómo funciona
Le mandas un PDF y te devuelve el mismo PDF con el número añadido en cada página, abajo en el centro por defecto. Puedes elegir la posición, el formato del texto (solo el número, o "3 de 10"), desde qué número empezar y qué páginas numerar. No guarda nada.
Si eliges solo algunas páginas (para saltarte una portada, por ejemplo), la numeración empieza en el número inicial que elijas DESDE la primera página seleccionada — no usa el número real de esa página en el documento.
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…).
Cómo usarlo en n8n (paso a paso)
Le envías tu PDF tal cual (como archivo binario) y te devuelve el PDF numerado directamente. En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-page-numbers - Send Query Parameters: actívalo y añade lo que quieras cambiar, ej.
position=bottom-right(ver la tabla para el resto). - 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 (módulo HTTP → Make a request): mismo método y URL, opciones en Query String, las dos cabeceras, y el PDF como dato binario en el cuerpo.
Opciones (en Query Parameters)
| Opción | Por defecto | Para qué sirve |
|---|---|---|
position | bottom-center | bottom-center, bottom-left, bottom-right, top-center, top-left, top-right. |
format | {n} | Texto del número. Usa {n} para el número y {total} para el total de páginas, ej. Página {n} de {total}. |
start | 1 | Número de la primera página numerada. |
pages | todas | Qué páginas numerar, ej. 2-10 para saltarte la portada. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/pdf-page-numbers - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: el PDF va en el cuerpo como
application/pdf(a pelo) o comoapplication/jsoncon{ "file": "<base64>", ... }. - Salida: por defecto, con
application/pdfdevuelve el binario; con JSON devuelve base64 enpdf. Añadeoutput=pdfooutput=jsonpara forzarlo. - 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 llamada = 1 crédito.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
position | bottom-center | 6 posiciones: combina top/bottom con left/center/right. |
format | {n} | Debe incluir {n} (sin él → 400). {total} es opcional y se refiere siempre al total de páginas del documento, no al número de páginas seleccionadas. |
start | 1 | Entero, 0–100000. |
pages | todas | Rango 1-indexado, ej. 2-10. La numeración es SECUENCIAL dentro de la selección: la primera página seleccionada recibe start, no su número real en el documento. |
font_size | 10 | 6–72. |
color | #000000 | Hex. |
margin | 24 | Puntos (0–200) desde el borde de la página. |
file | — | Solo en modo JSON: el PDF en base64. |
output | según modo | pdf (binario) o json (base64). |
Ejemplos
curl (PDF a pelo, formato "3 de 10"):
curl -X POST "https://api.cofferdock.com/pdf-page-numbers?format=%7Bn%7D%20de%20%7Btotal%7D" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/pdf" \
--data-binary @documento.pdf \
-o numerado.pdf
JavaScript (Node 18+, saltando la portada):
const fs = require('fs');
const params = new URLSearchParams({ pages: '2-10', start: '1', position: 'bottom-right' });
const r = await fetch(`https://api.cofferdock.com/pdf-page-numbers?${params}`, {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('documento.pdf'),
});
fs.writeFileSync('numerado.pdf', Buffer.from(await r.arrayBuffer()));
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-page-numbers',
params={'format': '{n} de {total}', 'position': 'bottom-center'},
headers={'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/pdf'},
data=open('documento.pdf', 'rb').read(),
)
open('numerado.pdf', 'wb').write(r.content)
Modo JSON (respuesta en base64)
{ "file": "JVBERi0xLjQ…", "format": "{n}/{total}", "position": "bottom-right" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_numbered": 10, "format": "{n}/{total}", "total_pages": 10, "used": 12, "remaining": 488 } }
Lo que recibes
El PDF numerado directamente, listo para guardar o enviar. (En modo JSON, el PDF llega en base64.)
PDF page numbers
Page numbers is an API that adds numbering to a PDF that doesn't have any. Great for reports, contracts or dossiers generated from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF and get back the same PDF with a number added to every page, bottom-center by default. You can choose the position, the text format (just the number, or "3 of 10"), which number to start from, and which pages to number. Nothing is stored.
If you only select some pages (to skip a cover page, for example), numbering starts at the number you choose FROM the first selected page — it doesn't use that page's real position in the document.
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).
How to use it in n8n (step by step)
You send your PDF as is (as binary data) and get the numbered PDF back directly. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-page-numbers - Send Query Parameters: on, and add whatever you want to change, e.g.
position=bottom-right(see the table for the rest). - 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 (HTTP → Make a request module): same method and URL, options in Query String, the two headers, and the PDF as binary data in the body.
Options (as Query Parameters)
| Option | Default | What it does |
|---|---|---|
position | bottom-center | bottom-center, bottom-left, bottom-right, top-center, top-left, top-right. |
format | {n} | The number's text. Use {n} for the number and {total} for the page count, e.g. Page {n} of {total}. |
start | 1 | The number for the first numbered page. |
pages | all | Which pages to number, e.g. 2-10 to skip a cover page. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-page-numbers - Auth: header
x-api-key: YOUR_KEY. - Input: the PDF goes in the body as
application/pdf(raw) or asapplication/jsonwith{ "file": "<base64>", ... }. - Output: by default, with
application/pdfit returns the binary; with JSON it returns base64 inpdf. Addoutput=pdforoutput=jsonto force it. - 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 call = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
position | bottom-center | 6 positions: combine top/bottom with left/center/right. |
format | {n} | Must include {n} (missing it → 400). {total} is optional and always refers to the document's total page count, not the number of selected pages. |
start | 1 | Integer, 0–100000. |
pages | all | 1-indexed range, e.g. 2-10. Numbering is SEQUENTIAL within the selection: the first selected page gets start, not its real position in the document. |
font_size | 10 | 6–72. |
color | #000000 | Hex. |
margin | 24 | Points (0–200) from the page edge. |
file | — | JSON mode only: the PDF in base64. |
output | per mode | pdf (binary) or json (base64). |
Examples
curl (raw PDF, "3 of 10" format):
curl -X POST "https://api.cofferdock.com/pdf-page-numbers?format=%7Bn%7D%20of%20%7Btotal%7D" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
-o numbered.pdf
JavaScript (Node 18+, skipping the cover page):
const fs = require('fs');
const params = new URLSearchParams({ pages: '2-10', start: '1', position: 'bottom-right' });
const r = await fetch(`https://api.cofferdock.com/pdf-page-numbers?${params}`, {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('document.pdf'),
});
fs.writeFileSync('numbered.pdf', Buffer.from(await r.arrayBuffer()));
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-page-numbers',
params={'format': '{n} of {total}', 'position': 'bottom-center'},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
open('numbered.pdf', 'wb').write(r.content)
JSON mode (base64 response)
{ "file": "JVBERi0xLjQ…", "format": "{n}/{total}", "position": "bottom-right" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_numbered": 10, "format": "{n}/{total}", "total_pages": 10, "used": 12, "remaining": 488 } }
What you get back
The numbered PDF itself, ready to save or send. (In JSON mode, the PDF comes in base64.)