npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-html-pdf-ariutomo

v1.0.6

Published

n8n custom node to convert HTML strings into PDF binary files using Puppeteer

Downloads

432

Readme

n8n-nodes-html-pdf

This is a custom n8n community node that allows you to easily convert HTML strings into PDF binary files using Puppeteer. It provides extensive customization options, including format sizing, page margins, orientation, header/footer templates, scaling, and custom output binary property names.

HTML to PDF Node Icon


Features

  • HTML to PDF Conversion: Input direct HTML strings and render them into high-fidelity PDF documents.
  • Customizable Output Field: Change the output binary field name (defaults to data).
  • Standard Sizing & Orientation: Select standard page formats (A0-A6, Letter, Legal, Tabloid, Ledger) or specify custom width/height dimensions.
  • Landscape Toggling: Switch between Portrait and Landscape modes.
  • Background Graphics: Choose whether to print background colors and images.
  • Margins Control: Define Top, Bottom, Left, and Right margins.
  • Header & Footer Templates: Inject custom HTML templates for page headers and footers with helper classes like pageNumber, totalPages, date, title, and url.
  • Scaling & Transparency: Scale page rendering and choose to omit white background for transparent PDFs.

Installation

For n8n Community Nodes (Recommended)

You can install this node via the Community Nodes panel in your n8n settings:

  1. Open your n8n instance.
  2. Go to Settings > Community Nodes.
  3. Click Install a community node.
  4. Enter the npm package name: n8n-nodes-html-pdf
  5. Accept the risk and click Install.

For Local Development / Self-Hosted n8n (Manual)

To install the node locally in your self-hosted n8n environment:

  1. Navigate to your n8n custom node installation directory (usually ~/.n8n/nodes/ or /home/node/.n8n/custom/node_modules/ in Docker environments).
  2. Install the package:
    npm install n8n-nodes-html-pdf
  3. Restart your n8n instance.

Configuration Options

1. HTML Input (Required)

The HTML content you want to convert into a PDF. You can pass raw HTML or drag in values/variables from previous nodes using n8n expressions.

2. Output Binary Field Name (Required)

The name of the binary property where the generated PDF file buffer will be stored. Defaults to data.

3. PDF Options (Optional)

Click Add Option to configure advanced print settings:

  • Format: The paper size (e.g. A4, Letter, Legal, Custom).
  • Width / Height: Set dimensions manually when using Custom format (e.g., 800px, 10in, 21cm).
  • Landscape: Toggles landscape print orientation.
  • Print Background: Set to true to include background graphics and CSS background colors.
  • Display Header/Footer: Displays the header and footer templates on every page.
  • Header / Footer Template: Custom HTML string templates. Use classes .pageNumber, .totalPages, .date, .title, or .url to inject dynamic values.
  • Margins: Top, Bottom, Left, Right margins (e.g., 10px, 0.5in, 1cm).
  • Scale: Scale factor of the webpage rendering (must be between 0.1 and 2).
  • Omit Background: Generates a PDF with transparent backgrounds instead of white.
  • Page Ranges: Subset of pages to print (e.g. '1-5, 8, 11-13').
  • Prefer CSS Page Size: Uses size dimensions declared in CSS @page over layout properties.

Local Development & Testing

1. Clone & Install Dependencies

git clone https://github.com/ariutomo/n8n-nodes-html-pdf.git
cd n8n-nodes-html-pdf
npm install

2. Build the Node

Compile the TypeScript code:

npm run build

3. Link for Local Testing

Link this package locally to your n8n instance to test:

npm link

Then inside your local n8n installation directory:

npm link n8n-nodes-html-pdf

And start n8n.


License

MIT