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-pdfconvert

v0.1.0

Published

n8n node for converting PDF files to images

Readme

n8n-nodes-pdfconvert

This package contains the PDF Convert node for n8n. It provides functionality to convert PDF files into individual page images (PNG/JPG format).

Features

  • ✅ Convert PDF files to images (PNG or JPG)
  • ✅ Process all pages or specific page ranges
  • ✅ Configurable image quality (DPI settings)
  • ✅ Support for binary data input
  • ✅ Reliable implementation using pdf2pic + GraphicsMagick
  • ✅ Perfect for document processing workflows

System Requirements

This node requires the following system dependencies to be installed on your n8n host:

  • GraphicsMagick - for image processing
  • Ghostscript - for PDF parsing

For Docker installations:

# Install system dependencies
docker exec -it --user root n8n apk add --no-cache graphicsmagick ghostscript

# Then install the node via n8n UI or:
docker exec -it n8n sh -c "cd /home/node/.n8n/nodes && npm install n8n-nodes-pdfconvert"

For Ubuntu/Debian:

sudo apt-get update
sudo apt-get install graphicsmagick ghostscript

For CentOS/RHEL:

sudo yum install GraphicsMagick ghostscript

Installation

To install this community node, follow the installation guide in the n8n docs.

Manual Installation

npm install n8n-nodes-pdfconvert

Usage

Node Configuration

The PDF Convert node provides the following configuration options:

Input Type

  • Binary Data: Use PDF data from file uploads or previous nodes
  • Base64: Use base64-encoded PDF string

Output Options

  • Output Format: Choose PNG or JPG for resulting images
  • Scale: Control image resolution (0.5x to 5x, default 2x)
  • Pages: Specify pages to convert (e.g., "1,2,3" or "1-5" or leave empty for all)

Input/Output Properties

  • Binary Property: Name of input property containing PDF data (default: "data")
  • Output Property Name: Name for output property containing converted images (default: "images")

Examples

Example 1: Convert all PDF pages to PNG

Input: PDF file via HTTP Request or File node
Configuration:
- Input Type: Binary Data
- Output Format: PNG
- Scale: 2
- Pages: (empty - converts all pages)

Example 2: Convert specific pages to high-res JPG

Input: PDF file
Configuration:
- Input Type: Binary Data  
- Output Format: JPG
- Scale: 3
- Pages: 1,3-5,10

Example 3: Convert base64 PDF to images

Input: Base64 PDF string
Configuration:
- Input Type: Base64
- Base64 Data: {{$json.pdfBase64}}
- Output Format: PNG
- Scale: 2

Output Format

The node outputs:

  • JSON Data: Metadata about converted images
  • Binary Data: Individual page images as binary data

JSON output structure:

{
  "images": [
    {
      "data": Buffer,
      "mimeType": "image/png",
      "fileName": "page_1.png", 
      "fileExtension": "png",
      "pageNumber": 1
    }
  ],
  "totalPages": 3,
  "outputFormat": "png",
  "scale": 2
}

Binary output: Each page is also available as binary data with property names like images_page_1, images_page_2, etc.

Use Cases

  • Extract pages from scanned documents
  • Convert PDF presentations to image slides
  • Generate thumbnails from PDF files
  • Process invoices/receipts for OCR workflows
  • Archive PDF content as individual images

Technical Details

  • Built with TypeScript for n8n
  • Uses pdf-img-convert library (lightweight, PDF.js-based)
  • No external dependencies (GraphicsMagick, Ghostscript)
  • Supports Node.js 20.15+

Development

Prerequisites

  • Node.js >= 20.15
  • n8n installed globally: npm install n8n -g

Setup

  1. Clone the repository
  2. Install dependencies: npm install
  3. Build the node: npm run build
  4. Link for development: npm link

Testing

npm run lint        # Check code quality
npm run build       # Build the project
npm run dev         # Watch mode for development

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions:

  1. Check the n8n documentation
  2. Open an issue on GitHub

Made with ❤️ for the n8n community