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 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-html-to-pdf-free

v0.5.3

Published

Free n8n node for converting HTML to PDF with automatic browser setup

Readme

n8n-nodes-html-to-pdf-free

This n8n node allows you to convert HTML content into PDF documents without requiring any external paid APIs. It uses Puppeteer with automatic Chromium management for reliable PDF generation.

Installation

Follow the installation guide in the n8n community nodes documentation.

Usage Instructions

  1. First Time Setup:

    • Add the HTML to PDF node to your workflow
    • Select "Check Chrome Status" operation
    • Execute the node to verify Chrome installation
    • If the status is not_ready, run the "Install Chrome Dependencies" operation to trigger the bundled installer
    • Follow the provided instructions if Chrome is still not found afterwards
  2. Converting HTML to PDF:

    • Select "Convert HTML to PDF" operation
    • Configure your HTML source and PDF settings
    • Execute the node

Chrome/Chromium Setup

Version 0.5.0: Adds inline "Install Chrome Dependencies" operation with actionable guidance.

Version 0.3.0: Improved Chrome detection and automatic installation.

The node will automatically try to:

  1. Use Puppeteer's bundled Chrome (if available)
  2. Find system-installed Chrome/Chromium
  3. Guide you through installation if Chrome is not found

Quick Chrome Installation

After installing the node, if you encounter Chrome-related errors:

  • Run the node with the Install Chrome Dependencies operation (recommended)
# Run the included installation script
npm run install-chrome

# OR manually install Chrome
npx puppeteer browsers install chrome

Platform-Specific Installation

Docker/Alpine Linux:

⚠️ For Docker users: See DOCKER_SETUP.md for complete setup instructions!

Quick fix - Add to your Dockerfile:

RUN apk add --no-cache chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y chromium-browser

CentOS/RHEL/Fedora:

sudo yum install -y chromium

macOS:

brew install --cask chromium
# OR download from https://www.google.com/chrome/

Windows: Download from https://www.google.com/chrome/

Troubleshooting

If Chrome is installed but not detected:

  1. Set the executable path explicitly:

    export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
  2. Reinstall the node:

    npm uninstall n8n-nodes-html-to-pdf-free
    npm install n8n-nodes-html-to-pdf-free
  3. Check Chrome installation:

    which chromium-browser || which chromium || which google-chrome

Manual Chromium Installation (if needed)

If you encounter issues with automatic Chromium download (e.g., in restricted environments), you can manually install Chromium:

For Docker/n8n Docker images:

# Add this to your Dockerfile
RUN apk add --no-cache chromium

# Set Puppeteer to use installed Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

For Ubuntu/Debian servers:

sudo apt-get update
sudo apt-get install -y chromium-browser

For CentOS/RHEL/Fedora:

sudo yum install -y chromium

Manual installation

To manually install this node:

  1. Install the node package in your n8n installation:

    npm install n8n-nodes-html-to-pdf-free
  2. Restart n8n

n8n is an n8n community node that allows you to convert HTML content to PDF documents in your n8n workflows.

n8n is a fair-code licensed workflow automation platform.

Installation
Operations
Credentials
Compatibility
Usage
Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Manual installation

To manually install this node:

  1. Install the node package in your n8n installation:

    npm install n8n-nodes-html-to-pdf
  2. Restart n8n

Operations

This node supports the following operations:

  • Convert HTML to PDF: Convert HTML content or HTML from a URL into a PDF document
  • Check Chrome Status: Verify whether Chrome/Chromium is reachable from your n8n runtime
  • Install Chrome Dependencies: Run the bundled installer and re-check the environment with actionable logs

Credentials

This node does not require any credentials.

Compatibility

  • n8n Version: Requires n8n version 0.170.0 or later
  • Node.js: Requires Node.js version 20 or later

Usage

Basic HTML to PDF conversion

  1. Add the HTML to PDF node to your workflow
  2. Configure the node:
    • HTML Source: Choose between "From Input Field" or "Direct HTML"
    • HTML Content: Enter your HTML content or reference a field from previous nodes
    • Filename: Set the output PDF filename
    • Page Format: Choose from A4, Letter, Legal, etc.
    • Orientation: Portrait or Landscape
    • Margins: Set page margins in mm

Example workflow

Here's a simple example that converts HTML to PDF:

  1. Start node
  2. Set node with HTML content
  3. HTML to PDF node to convert the HTML
  4. Write Binary File node to save the PDF

The node outputs:

  • A binary file containing the PDF
  • JSON data with metadata about the conversion

Troubleshooting

Error: "Failed to launch the browser process"

This error occurs when Chromium is not installed on your server. See the Prerequisites section above for installation instructions.

For n8n Cloud users

Unfortunately, this node may not work on n8n Cloud as it requires system-level Chromium installation. Consider using n8n self-hosted with proper Chromium setup.

Docker-specific setup

If you're using Docker, you might need to add these environment variables:

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

Resources

Changelog

v0.5.0

  • Feature: Added "Install Chrome Dependencies" operation to attempt automated Chromium setup from inside the node
  • Improvement: Clearer status responses with actionable next steps and documentation links
  • Improvement: Conversion operation now blocks early when Chrome is unavailable, avoiding cryptic Puppeteer errors

v0.4.0

  • New Feature: Added "Check Chrome Status" operation to verify Chrome installation within n8n
  • Improvement: Split operations - users can now check Chrome status before attempting conversion
  • UI Enhancement: Clear status messages and installation instructions shown directly in n8n
  • Better UX: All conversion-related fields now only show when "Convert HTML to PDF" operation is selected

v0.3.0

  • Major Fix: Completely revamped Chrome/Chromium detection and installation
  • Feature: Added automatic Chrome path detection for system-installed browsers
  • Feature: Added install-chrome script for easy Chrome installation
  • Improvement: Better fallback mechanisms when Puppeteer's Chrome is not available
  • Improvement: More comprehensive error messages with platform-specific instructions
  • Improvement: Support for various Chrome installation paths across different platforms

v0.2.1

  • Fix: Added postinstall script to ensure Chrome browser is downloaded
  • Improvement: Enhanced error messages with specific instructions for Chrome installation
  • Documentation: Added troubleshooting section for Chrome download issues

v0.2.0

  • Breaking Change: Migrated from html-pdf-node to puppeteer for better Chromium management
  • Feature: Automatic Chromium download - no manual installation required in most cases
  • Fix: Resolved "Failed to launch browser process" errors on production servers
  • Improvement: Better error messages when Chromium is not available
  • Improvement: Added browser cleanup in finally block to prevent resource leaks

v0.1.0

  • Initial release
  • Convert HTML to PDF with various formatting options
  • Support for HTML content from string or URL
  • Configurable page size, orientation, and margins

License

MIT

Author

Muhammad Faizan