unir-pdf

n8n node to extract plain text and AcroForm form field values from PDF files

Package Information

Released: 1 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 1.0.0
Author: UNIR

Documentation

n8n-nodes-unir-pdf

A single n8n node, PDF Fields & Text, that takes a PDF binary as input and returns:

  • text / numPages / info — plain text extracted with pdfjs-dist (the same engine the built-in "Extract from File" node uses)
  • fields / fieldCount — AcroForm form field names and values, extracted with pdf-lib

Both passes run in a single node, no Code node, no Task Runner, no module allowlist —
it's a normal n8n node, so it runs as trusted code in the main n8n process.

Install (no Docker rebuild needed)

~/.n8n/nodes is n8n's community-node folder. It's typically already inside your
persistent volume (e.g. n8n_data:/home/node/.n8n), so installing here survives
container restarts and image updates without touching your Dockerfile.

  1. Build the tarball once (from this folder, wherever you have Node/npm):
    npm pack
    # -> n8n-nodes-unir-pdf-1.0.0.tgz
    
  2. On the host, in the folder that's mounted as your n8n data volume:
    mkdir -p /path/to/n8n_data/nodes
    cd /path/to/n8n_data/nodes
    npm install /path/to/n8n-nodes-unir-pdf-1.0.0.tgz
    
  3. Restart the n8n container:
    docker restart n8n
    
  4. The node "PDF Fields & Text" now appears in the node panel.

Node options

Option Default Description
Input Binary Field data Name of the binary property holding the PDF
Extract Text true Run the pdfjs-dist text pass
Extract Form Fields true Run the pdf-lib AcroForm pass
Join Pages true Join all pages' text into one string vs. an array per page
Password (empty) Password for the text-extraction pass on encrypted PDFs — note: pdf-lib does not support decrypting password-protected PDFs, so form-field extraction will fail on an encrypted file regardless of this setting
Keep Source JSON Whether to keep the input item's JSON/binary alongside the extracted data

Notes

  • Field names come back as whatever the PDF's AcroForm declares (e.g. Zoho Sign's
    opaque numeric IDs) — map them to readable names downstream, ideally by field
    position (Object.values(fields)) rather than by literal ID if the same
    template is reused across documents, since IDs are assigned per document while
    field order stays stable.
  • Signature fields (/Sig type) come back as null — they're cryptographic, not
    text, and are already represented by whatever printed-name text field the form
    includes alongside the signature.

Discussion