Code & Transform

HTML to PDF Node

Render HTML markup or a web page into a PDF file.

Overview

The HTML to PDF node turns HTML into a PDF document inside your workflow. Write the HTML yourself with {{variables}} for the dynamic parts, or point it at a URL and it renders that page. The PDF is saved to a bucket in My Data, or kept as a temporary file, and stored in the output variable so later nodes can email it, upload it or return it.

Configuration

Field Description Default
Source HTML markup or URL HTML markup
HTML The markup to render. Supports {{variables}} -
File Name Output file name. The .pdf extension is added automatically document.pdf
Bucket The My Data bucket to save the file in -
Page Size A4, Letter or Legal A4
Orientation Portrait or Landscape Portrait
Margins Default, None, Narrow or Wide Default
Print background colors & images Include CSS backgrounds in the PDF On
Scale Render scale from 0.1 to 2. 1 is 100% 1
Extra Wait (ms) Extra time before capture, for content that renders late. Maximum 5000 0
On Error Stop Flow, Continue (empty output) or Continue (default value) Stop Flow
Output Variable Variable that holds the generated file pdf

Example: Invoice PDF by email

Query Data (order) → HTML to PDF → Mail (attach {{pdf}})
<html><body>
  <h1>Invoice {{order_id}}</h1>
  <p>Total: {{order_total}} EUR</p>
</body></html>

In the Mail node, put {{pdf}} on its own line under Attachments.

Best Practices

  • Use inline CSS or a <style> block in the HTML; the renderer has no access to your app's stylesheets.
  • Raise Extra Wait only when a URL source loads content with JavaScript after the page opens.
  • Pick a bucket when the file must be kept; leave it empty for a file you only send once.

We update these pages often. Spotted something out of date? Tell us

AI AssistantPowered by Ubex
Beta
Ask me anything about Ubex workflows, nodes, or the API.