Description
@kukhta_stepan/n8n-nodes-pdf-to-images
Professional n8n community node for document/image conversion to raster output, powered by pdfjs-dist and @napi-rs/canvas (no MuPDF or Poppler required).
What This Node Does
The node supports three practical workflows:
1. PDF -> JPG/PNG (page-by-page)
2. RTF -> JPG/PNG (page-by-page)
3. Image -> JPG (for PNG/JPEG/GIF/WebP/BMP inputs)
Node Details
- Display name:
PDF to Images - Node name:
pdfToImagesPdfJs - Type version:
3 - Input: binary data field (configured by
Binary Field Name) - Output: one or more items with generated image binaries plus metadata in
json - Input type is auto-detected inside this mode:
- Output format:
DPIcontrols page render scale and output size.- Supported inputs: PNG, JPEG, GIF, WebP, BMP
- Useful for
PNG -> JPGnormalization before OCR/storage pipelines. conversionModesourceType(pdf,rtf, orimage)page,totalPagesfileName,format,dpi(when applicable)width,heightbinaryKey,binaryField,binaryPrefix,binaryPageIndex- Prefix is set
- Prefix is empty
- page 1 keeps the original name, e.g.
data0 - next pages use suffix with underscore:
data01,data02, …
Operations
1) PDF/RTF -> images (each page)
This is the main operation for document conversion.
– %PDF- signature -> handled as PDF
– {rtf signature -> handled as RTF
– JPEG (smaller files)
– PNG (lossless)
If the file is neither valid PDF nor RTF, the node returns a clear validation error.
2) Image -> JPEG
Converts one raster image to one JPEG image.
Output Metadata
For each produced image item, json includes:
Binary Field Naming Rules
Output Binary Field (prefix) controls output key naming in item.binary.
Keys are always indexed: {prefix}0, {prefix}1, {prefix}2, …
The node preserves the resolved input binary field name (per item).
Fallback order:
1. Resolved Binary Field Name value
2. $json.binaryPropertyName
3. data
For multi-page PDF/RTF with empty prefix:
This avoids accidental renaming like data0 -> data00.
Install in n8n
1. Open Settings -> Community nodes -> Install
2. Install package:
– @kukhta_stepan/n8n-nodes-pdf-to-images
3. Reload n8n if prompted
Self-hosted environments must allow community packages (for example N8NCOMMUNITYPACKAGES_ENABLED).
Local Development
npm install
npm run build
Publish (Maintainers)
npm login
npm version patch
npm publish --access public
Notes:
--access public is requiredprepack runs npm run build automaticallyLicense
MIT