PDF

HTML to PDF

Renders HTML into a PDF (invoices, reports, tickets, contracts). Same rendering engine as /capture: inline CSS, web fonts and images allowed, no JavaScript. Send either html, or template + data (the "invoice" template works well as a PDF).

Costs 1 credit per call.

post/pdf

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/pdf
  • Auth: API key in header x-api-key

Request body

htmlstring

The HTML to render (max 5 MB). Required unless you use template.

template'social' | 'og' | 'invoice' | 'receipt' | 'certificate' | 'youtube'

Use one of our ready-made designs instead of sending html. Fields, example texts and sizes: https://cofferdock.com/templates.json

dataobject

Texts for the template, e.g. { "name": "Jane Doe", "course": "n8n basics" } for "certificate". Plain text only: everything is escaped. Fields you leave out keep the example text.

lang'en' | 'es'

Language of the example texts of the template.

format'A4' | 'A3' | 'A5' | 'Letter' | 'Legal' | 'Tabloid'

Paper size.

landscapeboolean

true = landscape page, false (default) = portrait.

margininteger

Margin in millimetres, same on all four sides.

print_backgroundboolean

Print background colours and images.

scalenumber

Content scale factor (0.1-2). Default 1; use a value below 1 to fit more on each page.

output'json' | 'binary' | 'url' | 'pdf'

How to return the PDF: "json" (base64 in the JSON response), "binary" (the PDF itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

Response

The resulting PDF (shape depends on output).

OR

Changes

No recorded changes to this operation across all 1 revision of this API.