Overview
This node converts HTML content into a PDF document using Puppeteer, a headless Chrome browser automation library. It is useful for scenarios where you need to generate PDF files from dynamic or static HTML content, such as creating reports, invoices, or printable documents from web content.
Use Case Examples
- Generating a PDF invoice from an HTML template.
- Creating a PDF report from dynamically generated HTML content.
Properties
| Name | Meaning |
|---|---|
| HTML Content | The HTML content to convert to PDF, provided as a string. |
| Chrome Executable Path | Optional absolute path to the Chrome or Chromium executable used by Puppeteer for PDF generation. |
Output
JSON
data- Base64 encoded string of the generated PDF file content.fileType- MIME type of the output file, which is 'application/pdf'.
Dependencies
- puppeteer-core library for headless Chrome PDF generation
Troubleshooting
- If the Chrome executable path is incorrect or not provided and Puppeteer cannot find a suitable Chrome/Chromium installation, the node will fail to launch the browser. Ensure the path is correct or that Chrome/Chromium is installed and accessible.
- Errors related to HTML content rendering may occur if the HTML is malformed or contains unsupported features. Validate the HTML before conversion.
- Large or complex HTML content may increase processing time or memory usage, potentially causing timeouts or failures. Optimize HTML content if needed.
Links
- Puppeteer Documentation - Official documentation for Puppeteer, the library used for HTML to PDF conversion.