New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

pdffr-langchain

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdffr-langchain

LangChain.js document loader backed by pdffr: PDF → Markdown documents per page, local, with OCR only where needed.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

pdffr-langchain

A LangChain.js document loader backed by pdffr: each PDF page becomes a Document of Markdown (headings, lists, tables, math), decompiled from the file's own glyph geometry in milliseconds, with on-device OCR only where a page needs it. Local and private — nothing is uploaded.

npm install pdffr-langchain @langchain/core
import { PdffrLoader } from 'pdffr-langchain';

const loader = new PdffrLoader('report.pdf', { lang: 'eng' });
const docs = await loader.load();
// docs[i].pageContent → markdown for page i+1
// docs[i].metadata    → { source, page, totalPages, ocrRegions, nativeChars }

// or one Document for the whole file
const [doc] = await new PdffrLoader('report.pdf', { splitPages: false }).load();

Also accepts a Blob/File or a Uint8Array instead of a path. Options: ocr (default true), lang, splitPages (default true), concurrency.

Because the output is Markdown, downstream splitters can chunk on headings (MarkdownTextSplitter) and tables survive as tables.

MIT © Amer Sarhan

Keywords

langchain

FAQs

Package last updated on 03 Sep 2026

Related posts