Plug Database icon

Plug Database

Run Plug Database commands over REST or Socket.

Tools → HTML to PDF

AI-generated

Summary

Render an HTML string into a PDF file using Chromium-based browser rendering and save the output as binary data in the specified property.

Inputs

  • Tool Category — Select the tool group to display, defaulting to Documents which includes PDF conversion.
  • HTML (required) — The HTML string content to be rendered and converted into PDF format.
  • CSS — Optional CSS styles to inject into the HTML document before rendering.
  • File Name — Filename to assign to the generated PDF file, defaulting to 'document.pdf'.
  • Output Binary Property — Name of the binary property where the resulting PDF data is stored, default is 'data'.
  • Browser Options — Settings controlling which browser executable to use, launch timeout, JavaScript enablement, and browser selection channel.
  • PDF Options — Settings influencing PDF rendering such as page format, orientation, margins, scaling, page readiness event to wait for, background printing, media emulation, header/footer templates, render delays, size limits, and prefer CSS page size flag.
  • Include Plug Tools Metadata — Flag to include generation metadata in the output JSON under the specified property.
  • Metadata Property — JSON property name where the generation metadata is stored when enabled.

Output shape

A single binary file containing the rendered PDF data is produced as a binary property in the node output item.

The generated PDF is stored in the binary property specified by 'Output Binary Property'. Optional metadata about the PDF generation is included in the output JSON item under the 'Metadata Property' if enabled. HTML and CSS inputs are subject to maximum size limits. The conversion process uses a Chromium-based browser instance with configurable rendering options and timeouts.

Examples

Example 1: Convert HTML content to PDF

Set the HTML property with your HTML string, optionally add CSS, specify file name, and leave other options as default. The node outputs a PDF binary file for next steps.

Links

Discussion