# PyMuPDF

Python document\-processing library built on MuPDF for rendering, extraction and PDF manipulation\.

ID: Q572 · Revision: 620

Type: software · License: GNU AGPL OR commercial license[^about] · Status: active

Website: https://pymupdf.readthedocs.io/en/latest/



PyMuPDF is a Python library built on MuPDF for extracting, analyzing, rendering and manipulating documents\. Its PDF functions include page operations, annotations and text handling\. The standard library is distinct from the optional PyMuPDF Pro and PyMuPDF4LLM products\.[^about]

## Opening and recognizing documents

PyMuPDF accepts several document and image types in addition to PDF\. It examines file content rather than relying solely on the filename extension, but text\-based formats may require an explicit type\. Remote content must be fetched by the surrounding application and passed as bytes or a stream\. Loading a whole large file into memory can therefore be an integration constraint rather than a capability implied by URL access\.[^open]

## Scanned content

OCR is an optional Tesseract\-based workflow rather than a universal property of ordinary text extraction\. Recognized text can be stored in a hidden layer or a reusable TextPage for later searches\. The documented image workflow does not reconstruct original bold, italic or font identity, and Tesseract does not recognize vector drawings as such\. A searchable result should therefore not be confused with recovering an editable original document\.[^ocr]

## Concurrency and packaging

The library does not support multithreaded use; its guide instead demonstrates separate processes for page\-oriented work\. A Document object cannot simply be passed as a pickled task argument, so each process opens its own document\. Installation normally uses a compatible wheel, with source compilation requiring native development tools when one is unavailable\. The legacy import name fitz can also collide with an unrelated package of that name\.[^parallel][^install]

## Edition and compatibility boundaries

The feature documentation describes limited standard\-library ingestion of DOCX, XLSX, PPTX and HWPX through HTML, losing original page separation and faithful layout\. It points to the separate Pro product where faithful Office rendering matters\. Other documentation presents Office support under Pro, so deployments should verify their exact version and input path rather than assume uniform Office parity from the product family name\.[^about][^open]

## Licensing and substitution

PyMuPDF is available through AGPL or commercial licensing\. It can substitute for selected [pypdf](/pypdf) page\-manipulation and text\-extraction tasks, with rendering available in the same library\. This requires adapting application code and accepting a native\-library deployment model rather than a pure\-Python implementation\. Platform\-wheel availability and the chosen license remain practical selection criteria, independently of whether both libraries can process a particular PDF\.[^about][^pypdf][^install]

## Capabilities and substitutions

### Document rendering and extraction — supported

Combines MuPDF rendering with Python access to document contents\.[^about]

Use case: Extract document content, render pages and manipulate PDFs in Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### OCR — limited

Tesseract must be installed separately; recognition produces text without original font styling\.[^ocr]

Use case: Extract document content, render pages and manipulate PDFs in Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### Multithreaded execution — unsupported

The documentation warns that concurrent thread use can malfunction or crash Python\.[^parallel]

Use case: Extract document content, render pages and manipulate PDFs in Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### Office layout preservation — limited

Standard\-library Office ingestion is described as HTML\-mediated extraction without faithful pagination; Pro is a separate option\.[^about]

Use case: Extract document content, render pages and manipulate PDFs in Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### [Substitute for pypdf](/pypdf) — limited

Can replace selected PDF page and text\-processing tasks when native MuPDF components and different licensing fit; existing pypdf APIs require adaptation\.[^about][^install][^pypdf]

Use case: Extract document content, render pages and manipulate PDFs in Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

## References

[^about]: [PyMuPDF features and licensing](<https://pymupdf.readthedocs.io/en/latest/about.html>) — MuPDF basis, product boundaries, Office caveats and licensing (vendor; retrieved 2026-10-07T13:43:28Z)

[^open]: [Opening documents](<https://pymupdf.readthedocs.io/en/latest/how-to-open-a-file.html>) — File recognition, formats and remote byte streams (vendor; retrieved 2026-10-07T13:43:28Z)

[^ocr]: [Integrated OCR](<https://pymupdf.readthedocs.io/en/latest/recipes-ocr.html>) — Separate Tesseract dependency, hidden text and reusable TextPage (vendor; retrieved 2026-10-07T13:43:28Z)

[^parallel]: [Multiprocessing guidance](<https://pymupdf.readthedocs.io/en/latest/recipes-multiprocessing.html>) — Unsupported multithreading and process\-based handling (vendor; retrieved 2026-10-07T13:43:28Z)

[^install]: [Installation](<https://pymupdf.readthedocs.io/en/latest/installation.html>) — Wheels, native compilation, legacy fitz package collision and platform limits (vendor; retrieved 2026-10-07T13:43:28Z)

[^pypdf]: [pypdf overview](<https://pypdf.readthedocs.io/en/stable/>) — Python page manipulation and text extraction (vendor; retrieved 2026-10-07T13:43:28Z)

Source revision: https://substitutefor.net/entities/Q572?revision=620
