Description
n8n-nodes-dante-pdf
A powerful n8n custom node for PDF conversion with support for multiple formats. Convert Markdown, HTML, Text, DOCX, and Images to PDF with ease, or merge multiple PDFs into one.
๐ Features
-
Multiple Format Support: Convert various formats to PDF
- ๐ Markdown to PDF – With theme support and Korean/CJK language support
- ๐ HTML to PDF – Full browser rendering with Chrome/Chromium
- ๐ Text to PDF – Simple text conversion with formatting options
- ๐ DOCX to PDF – Microsoft Word document conversion
- ๐ผ๏ธ Image to PDF – Convert images with layout options
- ๐ PDF Merge – Combine multiple PDFs into one
-
Advanced Features:
- ๐ Multi-language Support – Full support for Korean, Chinese, Japanese, and other languages
- ๐จ Theme Support – Multiple themes for Markdown (GitHub, Dark, Minimal)
- ๐ Custom Styling – CSS customization for HTML/Markdown
- ๐ Page Options – Headers, footers, page numbers
- โก High Performance – Optimized with Chrome/Chromium for quality and speed
- ๐ System Chrome Priority – Uses system Chrome/Chromium for better performance
๐ฆ Installation
๐ณ Docker Installation (Recommended for Production)
Quick Start with Docker Compose
- Create a
docker-compose.ymlfile:
version: '3.8'
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
ports:
- 5678:5678
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=password
volumes:
- n8n_data:/home/node/.n8n
- ./custom-nodes:/home/node/.n8n/custom
command: >
sh -c "
apk add --no-cache chromium chromium-chromedriver ttf-liberation fontconfig &&
npm install n8n-nodes-dante-pdf &&
n8n start
"
volumes:
n8n_data:
- Start the container:
docker-compose up -d
- Access n8n at
http://localhost:5678
Using Dockerfile (Custom Image)
Create a Dockerfile:
FROM docker.n8n.io/n8nio/n8n:latest
USER root
# Install Chromium for web automation
RUN apk add --no-cache chromium chromium-chromedriver
# Install Firefox and all required dependencies for PDF generation
RUN apk add --no-cache \
firefox \
firefox-esr \
ttf-liberation \
fontconfig \
gcompat \
libstdc++ \
dbus \
dbus-x11 \
mesa-gl \
mesa-dri-gallium \
udev \
xvfb
# Install Playwright globally
RUN npm install -g playwright-core
# Create symbolic links for Playwright to find browsers
RUN ln -sf /usr/bin/firefox /usr/bin/firefox-stable && \
ln -sf /usr/bin/chromium-browser /usr/bin/chromium
# Set environment variables
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV PLAYWRIGHT_BROWSERS_PATH=/usr/bin
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV PLAYWRIGHT_FIREFOX_EXECUTABLE_PATH=/usr/bin/firefox
USER node
# Install the PDF node
RUN npm install n8n-nodes-dante-pdf
# The package will automatically use system Chromium
Build and run:
docker build -t n8n-with-pdf .
docker run -d -p 5678:5678 -v n8n_data:/home/node/.n8n n8n-with-pdf
๐ป Windows Installation
Prerequisites for Windows
-
Install Node.js (18+ recommended):
- Download from nodejs.org
- Choose the LTS version
-
Install Chrome or Chromium:
-
Option A – Google Chrome (Recommended):
Download from: https://www.google.com/chrome/ -
Option B – Chromium:
Download from: https://www.chromium.org/getting-involved/download-chromium/
-
-
Install n8n globally:
npm install -g n8n -
Install the PDF node:
cd %USERPROFILE%\.n8n\custom npm install n8n-nodes-dante-pdf -
Verify Chrome is detected:
# The package will automatically find Chrome at: # C:\Program Files\Google\Chrome\Application\chrome.exe # or # C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -
Start n8n:
n8n start
Troubleshooting Windows
If Chrome is not detected:
# Set Chrome path explicitly (if needed)
set CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"
# Or install Playwright Chrome as fallback
cd %USERPROFILE%\.n8n\custom\node_modules\n8n-nodes-dante-pdf
npx playwright install chromium
๐ macOS Installation
Prerequisites for macOS
-
Install Node.js (18+ recommended):
# Using Homebrew brew install node # Or download from nodejs.org -
Install Chrome or Chromium:
-
Option A – Google Chrome (Recommended):
# Download from website open https://www.google.com/chrome/ # Or using Homebrew brew install --cask google-chrome -
Option B – Chromium:
brew install --cask chromium
-
-
Install n8n globally:
npm install -g n8n -
Install the PDF node:
cd ~/.n8n/custom npm install n8n-nodes-dante-pdf -
Verify Chrome is detected:
# The package will automatically find Chrome at: # /Applications/Google Chrome.app/Contents/MacOS/Google Chrome # or # /Applications/Chromium.app/Contents/MacOS/Chromium -
Start n8n:
n8n start
Troubleshooting macOS
If Chrome is not detected:
# Check if Chrome is installed
ls -la "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Install Playwright Chrome as fallback (if needed)
cd ~/.n8n/custom/node_modules/n8n-nodes-dante-pdf
npx playwright install chromium
๐ง Linux Installation (Ubuntu/Debian)
# Install Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Or install Chromium
sudo apt-get install chromium-browser
# Install n8n and the PDF node
npm install -g n8n
cd ~/.n8n/custom
npm install n8n-nodes-dante-pdf
# Start n8n
n8n start
Manual Installation (Development)
# Clone the repository
git clone https://github.com/dante-pdf/n8n-nodes-dante-pdf.git
cd n8n-nodes-dante-pdf
# Install dependencies
npm install
# Build and link to n8n
npm run build
npm run link
# Start n8n
n8n start
๐ Browser Configuration
Priority Order
The package searches for browsers in this order:
-
System Chrome/Chromium (Recommended)
- Windows:
C:\Program Files\Google\Chrome\Application\chrome.exe - macOS:
/Applications/Google Chrome.app - Linux:
/usr/bin/chromiumor/usr/bin/google-chrome
- Windows:
-
Playwright Chrome (Fallback – not available on Alpine Linux)
- Automatically downloaded if system Chrome not found
- Not compatible with Alpine Linux (musl libc)
Verify Installation
After installation, verify the browser setup:
// In n8n, create a test workflow with DantePDF node
{
"operation": "convertToPdf",
"conversionType": "textToPdf",
"inputType": "text",
"textContent": "Test PDF Generation"
}
๐ Usage
Basic Workflow Example
- Add a DantePDF node to your workflow
- Select the operation: Convert to PDF
- Choose conversion type (e.g., Markdown to PDF)
- Configure options:
- Input source (text, file, or binary data)
- Format options (A4, Letter, etc.)
- Theme (for Markdown)
- Additional settings
Markdown to PDF
// Node configuration
{
"operation": "convertToPdf",
"conversionType": "markdownToPdf",
"inputType": "text",
"markdownContent": "# Hello World\n\nThis is **markdown** content.",
"markdownOptions": {
"format": "A4",
"theme": "github",
"displayHeaderFooter": true
}
}
HTML to PDF
// Node configuration
{
"operation": "convertToPdf",
"conversionType": "htmlToPdf",
"inputType": "text",
"htmlContent": "<h1>Hello World</h1><p>HTML content</p>",
"htmlOptions": {
"format": "A4",
"printBackground": true,
"waitUntil": "networkidle"
}
}
๐จ Markdown Themes
The node includes 4 built-in themes for Markdown conversion:
- Default – Clean and professional
- GitHub – GitHub-style markdown rendering
- Dark – Dark mode theme
- Minimal – Simple, typography-focused
๐ Language Support
Full support for international languages including:
- ๐ฐ๐ท Korean (ํ๊ตญ์ด)
- ๐จ๐ณ Chinese (ไธญๆ)
- ๐ฏ๐ต Japanese (ๆฅๆฌ่ช)
- And many more…
The node automatically handles font embedding for proper rendering of all languages.
โ๏ธ Configuration Options
Common Options
format: Page size (A4, A3, A5, Letter, Legal, Tabloid)landscape: Landscape orientationdisplayHeaderFooter: Show header and footerscale: Scale of the webpage rendering (0.1 – 2)
Markdown Specific
theme: Visual themeprintBackground: Print background graphicspageRanges: Page ranges to print (e.g., '1-5, 8, 11-13')
HTML Specific
waitUntil: When to consider navigation succeededwaitFor: Wait for specific element or timeoutexecuteScript: JavaScript to execute before conversion
๐ ๏ธ Development
Prerequisites
- Node.js 18+
- n8n 1.0+
- TypeScript 5+
Setup
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Lint
npm run lint
# Format code
npm run format
Project Structure
n8n-nodes-dante-pdf/
โโโ src/
โ โโโ nodes/ # n8n node definitions
โ โโโ converters/ # Format converters
โ โโโ utils/ # Utility functions
โ โโโ types.ts # TypeScript types
โโโ test/ # Test files
โโโ package.json
โโโ tsconfig.json
๐งช Testing
# Run all tests
npm test
# Test specific converter
node test/test-markdown-converter.js
node test/test-html-converter.js
# Test with Korean content
node test/test-korean-converter.js
๐ Troubleshooting
Common Issues
Browser Not Found
- Windows: Ensure Chrome is installed in the default location or set
CHROME_PATHenvironment variable - macOS: Check if Chrome.app exists in Applications folder
- Linux: Install chromium-browser package
- Docker: Ensure Chromium is installed in the container
Alpine Linux / Docker Issues
- Must use system Chromium (Playwright browsers don't work with musl libc)
- Install required packages:
apk add chromium chromium-chromedriver ttf-liberation fontconfig
Font Issues
- Install additional fonts for better rendering
- Docker:
apk add font-noto font-noto-cjk - Ubuntu:
apt-get install fonts-noto fonts-noto-cjk - macOS: Fonts are usually pre-installed
๐ License
MIT
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ Known Issues
- Large files (>50MB) may cause memory issues
- Some complex CSS animations may not render in HTML to PDF
- Alpine Linux requires system Chromium (Playwright incompatible)
๐ฎ Support
- ๐ง Email: datapod.k@gmail.com
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐บ YouTube: Dante Labs
- ๐ฅ Tutorials: Check out our YouTube channel for tutorials and guides
๐ Acknowledgments
- Built with Playwright for reliable PDF generation
- Uses marked for Markdown parsing
- Powered by pdf-lib for PDF manipulation
Made with โค๏ธ for the n8n community