Markdown, blocks JSON, words, and Docling JSON output
quality="auto" is the default extraction tier: table structure, the document's own heading levels and OCR for pages without a text layer. Pass quality="fast" to keep the 1.2 output. On opendataloader-bench SDK 1.5.0 scores 0.9288 overall.* Auto needs a one-time model install, and OCR of scanned pages needs Tesseract on the machine. Release post · Benchmark results*Not on its public leaderboard. SDK 1.3.0 results were submitted to the benchmark repository, PR #37 and #38. Measured with the benchmark's own harness on its 200 documents; macOS arm64 wheel built from the 1.5.0 release candidate; other engines as published in its README, not re-run by us. Full caveats on the benchmarks page.On this page
Install PDFluent
# Rust
cargo add pdfluent@1.5.1
# Python
pip install pdfluent==1.5.0
# Node.js
npm install @pdfluent/node
# Models for the auto and balanced tiers
pdfluent models install layout tablesMarkdown, blocks JSON, words, and Docling JSON output Preview
from pdfluent import Document
from pdfluent.chunks import iter_chunks
with Document("report.pdf") as doc:
md = doc.extract_markdown() # fast tier, no models
md_tables = doc.extract_markdown(quality="balanced") # needs installed models
words = doc.extract_words()
for chunk in iter_chunks(doc, mode="markdown"):
print(chunk.text)- Step 1
Markdown output
extract_markdown returns Markdown: headings, list items, table cells, running heads. In Python the default quality="fast" runs the engine alone, written in Rust, with no models, and works everywhere including WebAssembly. quality="balanced" runs a layout model and a table-structure model locally through ONNX Runtime and is Markdown only: extract_markdown reads it, extract_blocks refuses it.
- Step 2
Blocks JSON output
extract_blocks returns blocks: paragraphs, headings with level, list items, table cells with grid position, running heads, each with page and box. In Rust, to_json(&blocks) renders the blocks as JSON. In WebAssembly and .NET, extractBlocks returns a JSON string.
- Step 3
Words output
extract_words returns words with boxes, for pipelines that need token-level positions rather than block structure. Python, Node, WebAssembly, Java and .NET all expose it.
- Step 4
Docling JSON output
extract_docling returns a Docling-shaped JSON (DoclingDocument) for pipelines built on Docling. Python, Node, WebAssembly, Java and .NET all expose it; in Python the call takes first_page, page_count and name.
- Structured extraction is Preview: output quality is still improving and the API may change in a minor release. Plain-text extraction is not Preview.
- The balanced tier is Preview and Markdown only. It runs a layout model and a table-structure model locally through ONNX Runtime 1.23.2 [B49, 2026-10-10]; native only, never WebAssembly; glibc Linux, macOS and Windows; on musl Linux loading returns a typed ModelError.
- Models install once, explicitly: pdfluent models install layout tables. From SDK 1.3.0, the Python package from PyPI installs the pdfluent command; in other setups it comes from the CLI archives on the release page. Nothing downloads automatically at run time. Without installed models, the balanced tier refuses with MODEL_NOT_AVAILABLE and the default auto tier reads the fast tier instead and says so.
- Table structure (A42, A43; measured 2026-10-17 on the held-out half): balanced (Preview) with the table model scores higher than Docling and pymupdf4llm on FinTabNet and PubTables-1M (TEDS), and higher than pymupdf4llm on ParseBench (record match).
- Office input to Markdown is covered by claims A31–A34 (measured 2026-10-04). In Python, pdfluent.extract_office(path_or_bytes, format="markdown") takes .docx, .pptx and .xlsx, routing by the file's content types rather than the extension; format="docling" returns DoclingDocument JSON.
- Which output shapes does structured extraction return?
- Markdown, blocks, words with boxes, chunks for retrieval pipelines, and a Docling-shaped JSON (DoclingDocument). All of it is Preview.
- Is the balanced tier available for every output shape?
- No. balanced is Markdown only: extract_markdown reads it, extract_blocks refuses it.
- Do I need to install models to use these formats?
- Only for the balanced tier. Models install once with pdfluent models install layout tables, and nothing downloads automatically at run time. The fast tier needs no models.