Markdown, blocks JSON, words, and Docling JSON output

PDFluent SDK 1.1.0 returns extraction output in several shapes — Markdown, blocks JSON, words with boxes, and a Docling-shaped JSON. Structured extraction is Preview.

Install PDFluent

The output formats on this page come from the structured extraction pipeline in PDFluent SDK 1.1.0. 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 install commands carry no version pin.

bash
# Rust
cargo add pdfluent@1.1.0

# Python
pip install pdfluent==1.1.0

# Node.js
npm install @pdfluent/node

# Models for the balanced tier (CLI from the 1.1.0 release archives)
pdfluent models install layout tables

Markdown, blocks JSON, words, and Docling JSON output Preview

Structured extraction returns more than one output shape. Markdown comes from extract_markdown, blocks from extract_blocks (and to_json in Rust), words with boxes from extract_words, and a Docling-shaped JSON (DoclingDocument) from extract_docling. Chunks for retrieval pipelines come from iter_chunks. Structured extraction is Preview: output quality is still improving and the API may change in a minor release.

python
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)
  1. Markdown output

    extract_markdown returns Markdown: headings, list items, table cells, running heads. In Python the default quality="fast" runs the engine alone, pure 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.

  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.

  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.

  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. The pdfluent command comes from the CLI archives on the 1.1.0 release page; pip install pdfluent==1.1.0 and npm install @pdfluent/node do not install it. Nothing downloads automatically at run time. Without installed models, the balanced tier refuses with MODEL_NOT_AVAILABLE.
  • Table structure (A38, A39, A40; measured 2026-10-14 on the tuning split): balanced (Preview) with the table model scores higher than Docling and pymupdf4llm on FinTabNet and PubTables-1M, and higher than pymupdf4llm on ParseBench.
  • 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.