pdf-extract

n8n community node that extracts text AND embedded images from PDF documents — pure JavaScript, no system dependencies

Package Information

Released: 1 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.3.0
Author: Enes Karaaslan

Documentation

n8n-nodes-pdf-extract

An n8n community node that extracts text and embedded images from PDF documents — pure JavaScript, powered by Mozilla's pdf.js. No Chromium, no Ghostscript, no system packages: it runs on any n8n install, including the hardened official Docker image.

n8n's built-in Extract From File node returns only text and silently drops every image. This node returns both:

  • Text — full document text plus a per-page array (text, pageTexts)
  • Markdown — json.markdown: the document reformatted as markdown, with headings inferred from font sizes, paragraphs reflowed, bullet lists normalized, and an image placeholder ![page-P-image-N.png](image_N) inserted at the position in the flow where each image appears — the placeholder name matches the output binary field, so you can swap placeholders for the actual images when building AI/vision requests
  • Images — every embedded image (figures, photos, charts, logos) decoded to PNG binaries, tagged with the page it appeared on

Perfect for feeding vision-capable AI models (DeepSeek vision, GPT-4o, Claude, Gemini): pass the exact text and the actual images instead of a lossy conversion.

Installation

Settings → Community Nodes → Install:

n8n-nodes-pdf-extract

Usage

Feed it any item with a PDF in a binary field (default data). Choose what to extract:

Mode Output
Text and Images json.text, json.pageTexts, json.images (metadata) + binaries image_0, image_1, …
Text Only json.text, json.pageTexts
Images Only image binaries + metadata

Image Output can also emit one item per image (binary field data), which pairs nicely with Split/Loop nodes and per-image AI calls.

Minimum Image Size (default 32 px) filters out bullets, rules, and tiny decorations.

Every image's metadata includes page, width, height, and fileName (e.g. page-3-image-2.png).

Example: PDF → AI vision model

  1. Download/receive the PDF (binary data)
  2. PDF Extract → Text and Images
  3. Code node: build a chat request whose content is [{type:'text', text: $json.text}, …one image_url block per binary] using data URLs
  4. HTTP Request → your vision model

Notes & limitations

  • Extracts embedded raster images as they are stored in the PDF. Vector-only drawings (pure line art with no raster component) are part of the page's drawing commands, not discrete images, and are not captured.
  • Scanned PDFs are typically one full-page image per page — those are extracted fine (the text layer, if absent, yields empty text; pair with a vision model for OCR).
  • Duplicated images that are reused across pages (e.g. a header logo) are extracted once.
  • Output images are re-encoded as PNG (lossless) regardless of their original codec.

Compatibility

Node.js ≥ 18.10, n8n 1.x. Self-hosted instances (n8n Cloud only permits verified community nodes).

License

MIT

Discussion