Channel guide

PDFluent for Python

Generally availableUpdated 2026-05-14
Star on GitHub
On this page

Install

One command. The package is on PyPI today.

pip install pdfluent==1.1.0

Smoke test

Open a PDF, print the page count. The example below is the smallest useful program — copy, paste, run.

python
import pdfluent

doc = pdfluent.open("invoice.pdf")
print(f"{doc.page_count()} pages")

Structured extraction (Preview)

PreviewIn Python, structured extraction returns Markdown from doc.extract_markdown, blocks from doc.extract_blocks, words from doc.extract_words, Docling JSON from doc.extract_docling, and chunks from pdfluent.chunks.iter_chunks. Structured extraction ships as Preview: output quality is still improving and the API may change in a minor release.

  • Tiers: fast (default, the engine alone, no models) and balanced (Preview, native only, needs installed models).
  • Enable balanced with quality="balanced"; set model paths with model_dir= and table_model_dir=.
  • Docling JSON: doc.extract_docling(first_page=0, page_count=None, name="document").
  • Page window: first_page (from zero) and page_count; iter_chunks(doc, mode="markdown") yields chunks with .text.

Guides: Structured extraction · Output formats · PyMuPDF-style Python API · 1.1.0 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)

SDK 1.1.0 for Python includes a compat layer that follows part of the PyMuPDF API. Coverage is partial and behaviour can differ in places, and it is an independent implementation, not PyMuPDF. The exact names in that namespace were under legal review as of 2026-10-08, so this page does not list them. Check the 1.1.0 release notes before building against that namespace.

What this is good for

  • Data and document pipelines
  • Batch processing of invoices, archives, and statements
  • Notebooks and scripted automation

Current limitations

This list is honest, not exhaustive. The site-wide list lives at Known limitations.

  • Pre-built wheels target common architectures; some platforms may need a build-from-source step.
  • XFA rendering fidelity is improving alongside the Rust core; complex dynamic forms may render with visual deltas.

Licensing

PDFluent is published under the AGPLv3 and is complete under it. A yearly commercial licence removes the obligation to publish your own source; nothing in the build differs and nothing is activated, so a lapsed licence breaks nothing you have shipped. Details on the licensing page.

Where to go next