HerramientasTools
Entrar Crear cuenta

HTML a PDF

HTML a PDF es una API que convierte un diseño en HTML en un documento PDF. Le mandas tu diseño y te devuelve el PDF, listo para guardar, enviar por email o imprimir. Perfecto para generar facturas, informes, tickets o certificados automáticamente desde n8n, Make o Zapier, sin montar servidores.

Cómo funciona

Esta herramienta convierte un diseño en HTML (texto con el aspecto que quieres, con su CSS, imágenes y tipografías) en un PDF. Tú le mandas el diseño y te devuelve el PDF, listo para guardar, enviar o imprimir.

Está pensada para usarla desde plataformas no-code como n8n, Make o Zapier, sin programar. Ideal para crear documentos automáticamente: facturas, informes, tickets, certificados, etc. No guarda nada: el PDF se genera al momento.

Lo único que necesitas

  • Tu API key (tu “contraseña” para la herramienta). 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 HTML tal cual y te devuelve el PDF directamente, listo para usar. En el nodo HTTP Request:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf
  • Send Query Parameters: actívalo y añade format = A4 (y lo que quieras: landscape, margin… ver la tabla).
  • Send Headers: actívalo y añade dos: x-api-key = tu llave, y Content-Type = text/html
  • Send Body: actívalo → Body Content Type: Raw → en Body pega tu HTML (o conéctalo desde un paso anterior)
  • En Options → Response → Response Format: elige File

La salida del nodo ya es el PDF como archivo: conéctalo directamente a Drive, email, Telegram… Un solo nodo y listo.

En Make (módulo HTTP → Make a request): mismo método y URL, en Query String añade format, en Headers las dos cabeceras, Body type: Raw, Content type: text/html y pega tu HTML en Request content. La respuesta ya es el archivo PDF.

En resumen: POST a …/pdf, el parámetro format como Query Parameter, las cabeceras x-api-key y Content-Type: text/html, el HTML en Body en modo Raw y Response Format en File.

Opciones (en Query Parameters)

Opciones que puedes añadir como Query Parameters (campos name/value en n8n/Make):

OpciónPor defectoPara qué sirve
formatA4Tamaño: A4, A3, A5, Letter, Legal, Tabloid.
landscapefalseApaisado (horizontal). Ponlo en true.
margin0Margen en milímetros (0–100), igual en los 4 lados.
scale1Escala del contenido (0,1–2).
print_backgroundtrueImprimir fondos y colores. Ponlo en false para fondo blanco.

Imágenes y fuentes de internet: puedes usar fotos, logos o tipografías alojadas en internet poniendo su enlace (https://…) dentro del HTML/CSS, y se cargarán en el PDF. El diseño se renderiza sin ejecutar JavaScript, así que usa HTML y CSS.

Lo que recibes

El PDF directamente (un archivo .pdf), listo para guardar, enviar por email o imprimir. No hay que convertir nada: el paso siguiente de tu automatización ya recibe el archivo. (En el modo técnico con JSON, el PDF llega en base64.)

Si en un pico recibes “ocupado”

En momentos de mucha demanda, la API puede responder “ocupado” (código 503) y pedirte que esperes unos segundos. Es raro y puntual, pero para que tu automatización lo resuelva sola, activa el reintento en el paso de la petición:

  • En n8n: en el nodo HTTP Request, pestaña Settings, activa “Retry On Fail”. Con 2–3 intentos sobra.
  • En Make: añade un manejador de errores al módulo (clic derecho → Add error handler) con la directiva Break, que reintenta automáticamente.

Nuestra respuesta incluye la cabecera Retry-After con los segundos que conviene esperar. Con el reintento activado, tu flujo ni se entera.

HTML to PDF

HTML to PDF is an API that turns an HTML design into a PDF document. You send your design and get the PDF back, ready to save, email or print. Great for generating invoices, reports, tickets or certificates automatically from n8n, Make or Zapier, with no servers to maintain.

How it works

This tool turns an HTML design (text describing how it should look, with its CSS, images and fonts) into a PDF. You send the design and it returns the PDF, ready to save, send or print.

It's made to be used from no-code platforms like n8n, Make or Zapier, without coding. Great for generating documents automatically: invoices, reports, tickets, certificates, etc. Nothing is stored: the PDF is generated on the fly.

All you need

  • Your API key (your “password” for the tool). 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 HTML as is and you get the PDF back directly, ready to use. In the HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf
  • Send Query Parameters: on, and add format = A4 (and whatever you want: landscape, margin… see the table).
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = text/html
  • Send Body: on → Body Content Type: Raw → paste your HTML in Body (or connect it from a previous step)
  • Under Options → Response → Response Format: choose File

The node's output is already the PDF as a file: connect it straight to Drive, email, Telegram… One node and done.

In Make (HTTP → Make a request module): same method and URL, in Query String add format, in Headers the two headers, Body type: Raw, Content type: text/html, and paste your HTML into Request content. The response is already the PDF file.

In short: POST to …/pdf, format as a Query Parameter, the x-api-key and Content-Type: text/html headers, your HTML in Body as Raw, and Response Format as File.

Options (as Query Parameters)

Options you can add as Query Parameters (name/value fields in n8n/Make):

OptionDefaultWhat it does
formatA4Size: A4, A3, A5, Letter, Legal, Tabloid.
landscapefalseLandscape orientation. Set it to true.
margin0Margin in millimetres (0–100), same on all sides.
scale1Content scale (0.1–2).
print_backgroundtruePrint backgrounds/colors. Set false for white background.

Internet images and fonts: you can use photos, logos or fonts hosted online by putting their link (https://…) inside the HTML/CSS, and they'll load into the PDF. The design is rendered without running JavaScript, so use HTML and CSS.

What you get back

The PDF itself (a .pdf file), ready to save, email or print. Nothing to convert: the next step of your automation already receives the file. (In technical mode with JSON, the PDF comes in base64.)

If you get “busy” during a spike

At peak times, the API may reply “busy” (status 503) and ask you to wait a few seconds. It's rare and brief, but to let your automation handle it on its own, turn on retry on the request step:

  • In n8n: on the HTTP Request node, Settings tab, turn on “Retry On Fail”. 2–3 attempts is plenty.
  • In Make: add an error handler to the module (right-click → Add error handler) with the Break directive, which retries automatically.

Our response includes a Retry-After header telling how many seconds to wait. With retry on, your flow won't even notice.