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

Source: https://pdfluent.com/how-to/extraction-formats/

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.

**New in SDK 1.3.0:** `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](https://pdfluent.com/blog/sdk-1-3-0/) · [Benchmark results](https://pdfluent.com/benchmarks/#odl-bench) *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

- Markdown, blocks JSON, words, and Docling JSON output 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.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 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.

Values move with their headings.

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. Step 1 Markdown outputextract_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.
2. Step 2 Blocks JSON outputextract_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. Step 3 Words outputextract_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. Step 4 Docling JSON outputextract_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.

## Related

[Structured extraction](https://pdfluent.com/how-to/extraction/)[1.1.0 release](https://pdfluent.com/blog/sdk-1-1-0-structured-extraction/)[Docling comparison](https://pdfluent.com/benchmarks/text-extraction-vs-docling/)[Python docs](https://pdfluent.com/docs/python/)
