HTML to PDF in n8n Cloud with only a Code node (free, tested workflow)

I saw several threads asking how to turn HTML (an email body, a report, an invoice) into a PDF on n8n Cloud, where you cannot install extra modules. I built a small version that uses only a Code node, and I am sharing it so you can try it and tell me where it breaks.

What it does: it takes json.html and returns a PDF as binary property data. The Code node builds the PDF file itself (Helvetica text, A4 pages, word wrap and page breaks), so there is no API key, no community node and no paid service.

What I tested: I imported it into n8n Cloud on 26 October 2026 and ran it manually. It makes two sample PDFs, reads them back with the Extract From File node (PDF operation) and checks that the expected text is there. Both checks passed: a 1-page invoice sample and a 3-page long report.

What it supports: headings h1 to h3, paragraphs, bullet and numbered lists, line breaks, preformatted text, horizontal rules and common HTML entities.

What it does not do: CSS, images, tables, clickable links, inline bold or italic, or non-Latin text (those print as ?). It is not a browser, so a styled web page will not look the same. If you need pixel-perfect pages, a browser-based PDF service is the better tool.

Not tested: very large inputs, emoji, and HTML from real email clients. Please try it with your own HTML and tell me what breaks, and I will update the workflow.

Download (free, MIT license): n8n-free-workflow-templates/html-to-pdf at main · operantsolo-com/n8n-free-workflow-templates · GitHub

Import operantsolo-html-to-pdf.json into a new blank workflow and click Execute workflow. The Check results node should show passed: true. To use it on your own data, replace the Sample HTML node with items that have a html field.