HTML PDF
Overview
The HTML to PDF Node converts HTML content into a downloadable PDF file. It allows you to design and format professional-looking documents such as reports, invoices, articles, or certificates using HTML and CSS, and then automatically generate a PDF file.
Description
Convert HTML to PDF.
The HTML to PDF Node is used to transform structured HTML content into a PDF document. You can either manually write your HTML or let AI generate a template.
Report Generation
Create data-rich reports from workflow outputs.
Invoices & Docs
Generate professional invoices and certificates.
Once executed, the node returns a file URL to the generated PDF, which can be downloaded or used in subsequent workflow steps such as "Send Mail" or "Upload File".
Input Parameters
The node accepts the following inputs:
htmlContentstringRequired"<html><body><h1>Hello</h1></body></html>"pdfSizestringOptional"A4"aiTemplateDescriptionstringOptional"Invoice for services rendered..."Output Parameters
After successful execution, the node returns:
fileUrlstringOptional"https://storage.com/pdfs/doc.pdf"fileIdstringOptional"12345-abcde"pdfSizestringOptional"A4"generatedAtstringOptional"2025-10-29T11:30:43.241Z"Output Type
Output Type: File Object
The node outputs a file object including metadata and a downloadable link.
Example Usage
Example 1: Simple Article Conversion
Convert basic HTML to PDF.
{ "htmlContent": "<html><body><h1>My First PDF</h1><p>Generated from HTML.</p></body></html>", "pdfSize": "A4"}
{ "fileUrl": "https://example-storage.com/pdfs/my-first-pdf.pdf", "fileId": "12345-abcde", "pdfSize": "A4", "generatedAt": "2025-10-29T11:30:43.241Z"}
Example 2: Styled Template
Convert styled HTML with CSS.
{ "htmlContent": "<!DOCTYPE html><html><head><style>h1{color:blue;}</style></head><body><h1>Invoice</h1></body></html>", "pdfSize": "A4"}
{ "fileUrl": "https://storage.com/pdfs/invoice.pdf", "fileId": "8ecc2a09-...", "pdfSize": "A4"}
How to Use in a No-Code Workflow
Add the Node
Add the HTML to PDF node to your workflow.
Provide HTML
Write or paste your HTML code in the editor, or use variables to inject data.
Set Size
Choose the PDF Size (e.g., A4).
Use Output
Connect the fileUrl output to a Send Mail node to email the PDF.
Best Practices
- Keep HTML simple and structured.
- Use inline CSS or
<style>blocks. - Preview HTML before generating.
Do / Don’t
- ✔️ Use variables to make templates dynamic.
- ✔️ Use standard fonts for better compatibility.
- ✔️ Test with different screen sizes in mind.
- ❌ Don’t use external image URLs unless public.
- ❌ Don’t use complex JavaScript (it won't execute).
- ❌ Don’t create extremely large HTML pages (performance issues).
Common Errors
Invalid HTMLErrorOptionalUnsupported Fonts/ImagesWarningOptionalExample Workflow Integration
Use Case: Send Invoice
Generate and email an invoice.
- Fetch Data: Get order details from DB.
- HTML to PDF: Generate invoice using order data.
- Send Mail: Attach the PDF and send to customer.
Workflow Data Flow:
{{db.orderId}} → {{htmlToPdf.htmlContent}}
{{htmlToPdf.fileUrl}} → {{sendMail.attachment}}
