pdfboss.dev

Compare

pdfboss vs PyMuPDF.

Both read PDFs from Python. PyMuPDF wraps MuPDF, a C engine, and ships under the AGPL-3.0 or a commercial license from Artifex. pdfboss is written from scratch in Rust, dual-licensed MIT OR Apache-2.0, and faster on the operations measured below. Here is where each one stands, gaps included.

At a glance
pdfbossPyMuPDF
LicenseMIT OR Apache-2.0AGPL-3.0, or a commercial license from Artifex
EngineWritten from scratch in safe Rust; no C dependenciesPython bindings to MuPDF, written in C
Text extraction10,312 pages/s435 pages/s (40 real-world PDFs, same machine)
Rendering to PNG, PPM, BMP or JPEG161.9 pages/s89.4 pages/s (38 certified files, 888 pages)
Scanned JBIG2 book65.2 pages/s51.7 pages/s (544 pages at 1:1)
PDF to Markdownpdfboss md: NID 0.883, 0.15 s for 200 PDFspymupdf4llm: NID 0.886, 17.12 s for 200 PDFs
Async and remoteAsyncDocument over files and HTTP range requestsSynchronous API
Editing existing PDFsNot supported; creation onlyAnnotations, forms, redaction, page manipulation
OCRNoYes, through Tesseract
Other formatsPDF onlyXPS, EPUB, MOBI, FB2, CBZ, SVG and images
ReportingEvery dropped or approximated item is reported per pageWarnings through MuPDF's error stack

Throughput rows come from the pdfboss benchmark harness; the Markdown row from opendataloader-bench, where the pymupdf4llm timing is the one published with the corpus. License statements are PyMuPDF’s own.

Migration

The reading path, side by side.

Documents index like lists, pages are 0-based in both, and render returns PNG, PPM, BMP or JPEG bytes directly instead of a pixmap you serialize. extract_text() on the document covers all pages and spreads them across cores.

before.py · PyMuPDF
import pymupdf

doc = pymupdf.open("report.pdf")
text = "".join(page.get_text() for page in doc)

pix = doc[0].get_pixmap(matrix=pymupdf.Matrix(2, 2))
png = pix.tobytes("png")

for info in doc[0].get_images(full=True):
    image = doc.extract_image(info[0])
after.py · pdfboss
import pdfboss

doc = pdfboss.Document("report.pdf")
text = doc.extract_text()

png = doc[0].render(scale=2.0)

for image in doc[0].extract_images():
    image.width, image.height, image.data

Where PyMuPDF is ahead

What PyMuPDF does that pdfboss does not.

  • Edits existing PDFs: annotations, form fields, redaction, page insertion and deletion, incremental saves.
  • OCR through Tesseract, and rendering of many non-PDF formats.
  • Two decades of MuPDF rendering coverage on unusual files. pdfboss is younger; it reports what it cannot paint rather than guessing, and its rendering benchmark is restricted to files it provably rasterizes completely.

Where pdfboss is ahead

What pdfboss does that PyMuPDF does not.

  • Permissive licensing: MIT OR Apache-2.0, so commercial and SaaS use carries no copyleft obligation and no commercial license to buy.
  • Speed on the read path: 24 times faster text extraction and 1.8 times faster rendering on the measured corpus, with no C in the wheel.
  • Async reading over HTTP range requests, so a page from a remote file arrives without downloading the file.
  • A jq-style query language and a terminal explorer over the document's element tree (pdfboss q, hex, json, tui).
  • Deterministic PDF creation from a composable Python API and a Markdown-to-PDF path with CSS themes.

Questions

Is pdfboss a drop-in replacement for PyMuPDF?
No. The APIs differ and pdfboss covers a smaller surface: reading PDFs (text, Markdown, styled spans, rendering, embedded images) and creating new ones, but not editing existing files. Migrating the reading path is usually a few lines per call site.
Can I use pdfboss in commercial or closed-source software?
Yes. pdfboss is dual-licensed MIT OR Apache-2.0, permissive licenses with attribution requirements and no copyleft. PyMuPDF is licensed under the AGPL-3.0 unless you buy a commercial license from Artifex.
Is pdfboss faster than PyMuPDF?
On the operations measured, yes: text extraction runs about 24 times faster over 40 real-world PDFs (10,312 against 435 pages per second), rendering about 1.8 times faster over 888 certified pages (161.9 against 89.4), and a 544-page JBIG2 scan about 26% faster (65.2 against 51.7). Converting the 200-document opendataloader-bench corpus to Markdown takes 0.15 seconds against pymupdf4llm's 17.12, with a slightly lower reading-order score (0.883 against 0.886).
Does pdfboss need MuPDF or any other C library installed?
No. pdfboss is written from scratch in Rust, including its JPEG 2000, JBIG2, CCITT and ICC decoders, and the Python wheel has no native dependency beyond CPython 3.12 or later.