n8n-nodes-html-to-pdf-free
v0.5.3
Published
Free n8n node for converting HTML to PDF with automatic browser setup
Maintainers
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
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
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:
- Use Puppeteer's bundled Chrome (if available)
- Find system-installed Chrome/Chromium
- 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 chromePlatform-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-browserUbuntu/Debian:
sudo apt-get update
sudo apt-get install -y chromium-browserCentOS/RHEL/Fedora:
sudo yum install -y chromiummacOS:
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:
Set the executable path explicitly:
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browserReinstall the node:
npm uninstall n8n-nodes-html-to-pdf-free npm install n8n-nodes-html-to-pdf-freeCheck 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-browserFor Ubuntu/Debian servers:
sudo apt-get update
sudo apt-get install -y chromium-browserFor CentOS/RHEL/Fedora:
sudo yum install -y chromiumManual installation
To manually install this node:
Install the node package in your n8n installation:
npm install n8n-nodes-html-to-pdf-freeRestart 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:
Install the node package in your n8n installation:
npm install n8n-nodes-html-to-pdfRestart 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
- Add the HTML to PDF node to your workflow
- 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:
- Start node
- Set node with HTML content
- HTML to PDF node to convert the HTML
- 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-browserResources
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-chromescript 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-nodetopuppeteerfor 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
Author
Muhammad Faizan
- Email: [email protected]
- GitHub: @mfa1zan
