HerramientasTools
Entrar Crear cuenta

Rellenar formulario PDF

Rellenar formulario es una API que mete datos en una plantilla PDF que ya tiene campos de formulario (esos PDF donde puedes hacer clic y escribir). Perfecto para generar contratos, solicitudes o fichas rellenas desde n8n, Make o Zapier, sin montar servidores.

Cómo funciona

Necesitas una plantilla PDF con campos de formulario ya creados (no vale un PDF normal sin campos; los formularios rellenables se hacen con Adobe Acrobat u otro editor de formularios). Le mandas la plantilla y un objeto con los valores, y te devuelve el PDF relleno.

¿No sabes qué campos tiene tu plantilla? Llama a la API SIN el objeto de datos y te devuelve la lista de campos disponibles (su nombre y tipo) en vez de rellenar nada — así puedes descubrirlos antes de automatizar. Esto también gasta 1 crédito, igual que rellenar.

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…).
  • Tu plantilla PDF con campos de formulario.

Paso 1: descubre los campos de tu plantilla

En el nodo HTTP Request de n8n:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf-fill-form
  • Send Headers: actívalo y añade dos: x-api-key = tu llave, y Content-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 plantilla, normalmente data)

La respuesta trae la lista de campos con su nombre y tipo, por ejemplo: { "fields": [{ "name": "nombre_cliente", "type": "text" }, { "name": "acepto", "type": "checkbox" }] }. Usa esos nombres exactos en el paso 2.

Paso 2: rellena la plantilla

Cambia el cuerpo a JSON (para poder mandar la plantilla y los datos juntos):

  • Send Body: JSON{ "file": "<tu plantilla en base64>", "data": { "nombre_cliente": "Ana García", "acepto": true } }
  • Send Headers: x-api-key = tu llave, Content-Type = application/json
  • En Options → Response → Response Format: elige File (la respuesta ya es el PDF relleno)

Convierte tu plantilla a base64 con un nodo Code y la expresión {{'{{'}}$binary.data.toString('base64'){{'}}'}}, o con el nodo Move Binary Data.

Si un nombre de campo no existe en la plantilla (por ejemplo un typo), esa llamada NO falla: rellena los campos que sí reconoce y avisa de los que no en la cabecera X-Warnings (o en warnings si pides output=json).

Opciones (en el JSON)

OpciónPor defectoPara qué sirve
dataObjeto con { "nombre_del_campo": "valor" }. Si lo omites, la API responde con la lista de campos en vez de rellenar.
flattenfalsetrue deja el PDF "congelado": los valores ya no se pueden editar en un lector de PDF.

Lo que recibes

En modo inspección: un JSON con la lista de campos. En modo relleno: el PDF relleno directamente (o en base64 con output=json).

Fill PDF form

Fill form is an API that puts data into a PDF template that already has form fields (the kind of PDF where you can click and type). Great for generating filled contracts, applications or forms from n8n, Make or Zapier, with no servers to maintain.

How it works

You need a PDF template with form fields already built in (a plain PDF with no fields won't work; fillable forms are made with Adobe Acrobat or another form editor). You send the template and an object of values, and get back the filled PDF.

Don't know what fields your template has? Call the API WITHOUT the data object and it returns the list of available fields (their name and type) instead of filling anything — so you can discover them before automating. This also costs 1 credit, same as filling.

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).
  • Your PDF template with form fields.

Step 1: discover your template's fields

In n8n's HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf-fill-form
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = application/pdf
  • Send Body: on → choose the binary file option (in n8n: "n8n Binary File", with your template's binary property, usually data)

The response carries the list of fields with their name and type, e.g.: { "fields": [{ "name": "customer_name", "type": "text" }, { "name": "agree", "type": "checkbox" }] }. Use those exact names in step 2.

Step 2: fill the template

Switch the body to JSON (to send the template and the data together):

  • Send Body: JSON{ "file": "<your template in base64>", "data": { "customer_name": "Jane Doe", "agree": true } }
  • Send Headers: x-api-key = your key, Content-Type = application/json
  • Under Options → Response → Response Format: choose File (the response is already the filled PDF)

Convert your template to base64 with a Code node using {{'{{'}}$binary.data.toString('base64'){{'}}'}}, or with the Move Binary Data node.

If a field name doesn't exist in the template (say, a typo), that call does NOT fail: it fills the fields it recognizes and warns about the rest in the X-Warnings header (or in warnings if you ask for output=json).

Options (in the JSON)

OptionDefaultWhat it does
dataObject with { "field_name": "value" }. Omit it and the API responds with the field list instead of filling.
flattenfalsetrue "freezes" the PDF: values can no longer be edited in a PDF reader.

What you get back

Inspect mode: a JSON with the field list. Fill mode: the filled PDF itself (or in base64 with output=json).