n8n-nodes-pdf2md
v0.1.2
Published
n8n community node: convert a PDF (binary) to semantic Markdown in-process via @opendocsg/pdf2md. No external API.
Maintainers
Readme
n8n-nodes-pdf2md
n8n community node that converts a PDF (binary) into semantic Markdown entirely in-process via @opendocsg/pdf2md. No external API, no network calls — the PDF never leaves your n8n instance.
Built after the n8n-nodes-pdf-extractor community node crashed (TypeError: …reading 'indexOf') on designed multi-page PDFs; @opendocsg/pdf2md parses them without crashing (heuristic font-size → heading detection).
Node: PDF to Markdown (pdf2md)
| Parameter | Default | Purpose |
|---|---|---|
| Input Binary Field | data | Binary property holding the PDF |
| Output Field | markdown | JSON field the Markdown is written to |
| Demote Headings One Level | false | Shift every heading down one level (H1→H2 … cap H6). Enable when the Markdown is nested under another H1 (e.g. PRIMA's # Content) so the document's own H1s don't end that section early. |
Output item = the input json plus { [outputField]: markdown }, binary preserved on the item. Honours Continue On Fail (emits { error } instead of throwing).
Build
npm install
npm run build # -> dist/Install into self-hosted n8n
Option A — publish to npm, then GUI install (easiest for users):
npm login
npm publish # publishes n8n-nodes-pdf2mdThen in n8n: Settings → Community Nodes → Install → n8n-nodes-pdf2md.
Option B — install the packed tarball without publishing:
npm pack # -> n8n-nodes-pdf2md-<ver>.tgz
# copy the tgz to the n8n host, then in the n8n custom-extensions dir:
cd ~/.n8n/custom && npm init -y 2>/dev/null; npm install /path/to/n8n-nodes-pdf2md-<ver>.tgz
# ensure N8N_CUSTOM_EXTENSIONS=~/.n8n/custom and restart n8nNote
Heuristic extractors (this, unpdf, Jina-keyless) infer structure from font geometry — great on single-column reports/papers, noisier on heavily-designed magazine layouts. For pixel-perfect structure on designed PDFs, an LLM/vision converter (MarkItDown-with-LLM, Jina ReaderLM) is required.
