Render Template as PDF
AI-generatedSummary
Render a template with variables and return it as a PDF file
Inputs
- templateId (required) — Template to render, selected from list or provided by ID
- variables (required) — Template variable values to substitute into the template
- pdfOptions — PDF rendering options such as page size, margins, orientation, etc.
Output shape
Binary PDF file plus a JSON metadata object
The binary part contains the PDF content; the JSON part includes templateId, success flag, filename, and optional pdfUrl. It is emitted as a binary output item.
Examples
Example 1: Render a resized invoice template with custom data and download the PDF.
templateId = list selection; variables = {"customer":"Acme", "order":123}; pdfOptions = {pageSize:"A4", orientation:"portrait", marginTop:"2cm"}
Example 2: Generate a PDF report from a template using JSON variables supplied via previous nodes.
templateId = id: "reportTemplate"; variables = {"date": "2025-11-03", "sales": 4523}; pdfOptions = {"scale": 1.2, "printBackground": false}
Example 3: Render a template with looped variables and output the PDF with custom margins.
templateId = id: "catalog"; variables = {"loopVariables": {"items": [{"name":"Shirt","price":20}]}}; pdfOptions = {"marginTop":"10mm","marginBottom":"5mm"}