{"schemaVersion":"1.0","record":{"label":"PyMuPDF","description":"Python document-processing library built on MuPDF for rendering, extraction and PDF manipulation.","aliases":[],"kind":"software","website":"https://pymupdf.readthedocs.io/en/latest/","overview":"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.","license":"GNU AGPL OR commercial license","lifecycle":"active","example":false,"features":[{"name":"Document rendering and extraction","status":"supported","detail":"Combines MuPDF rendering with Python access to document contents.","useCase":"Extract document content, render pages and manipulate PDFs in Python","platforms":["Windows","macOS","Linux","Python"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pymupdf.readthedocs.io/en/latest/about.html","locator":"MuPDF basis, product boundaries, Office caveats and licensing","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}]},{"name":"OCR","status":"limited","detail":"Tesseract must be installed separately; recognition produces text without original font styling.","useCase":"Extract document content, render pages and manipulate PDFs in Python","platforms":["Windows","macOS","Linux","Python"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pymupdf.readthedocs.io/en/latest/recipes-ocr.html","locator":"Separate Tesseract dependency, hidden text and reusable TextPage","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}]},{"name":"Multithreaded execution","status":"unsupported","detail":"The documentation warns that concurrent thread use can malfunction or crash Python.","useCase":"Extract document content, render pages and manipulate PDFs in Python","platforms":["Windows","macOS","Linux","Python"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pymupdf.readthedocs.io/en/latest/recipes-multiprocessing.html","locator":"Unsupported multithreading and process-based handling","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}]},{"name":"Office layout preservation","status":"limited","detail":"Standard-library Office ingestion is described as HTML-mediated extraction without faithful pagination; Pro is a separate option.","useCase":"Extract document content, render pages and manipulate PDFs in Python","platforms":["Windows","macOS","Linux","Python"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pymupdf.readthedocs.io/en/latest/about.html","locator":"MuPDF basis, product boundaries, Office caveats and licensing","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}]}],"alternatives":[],"slug":"pymupdf","draftAlternatives":[{"targetSlug":"pypdf","status":"limited","detail":"Can replace selected PDF page and text-processing tasks when native MuPDF components and different licensing fit; existing pypdf APIs require adaptation.","useCase":"Extract document content, render pages and manipulate PDFs in Python","platforms":["Windows","macOS","Linux","Python"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://pypdf.readthedocs.io/en/stable/","locator":"Python page manipulation and text extraction","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/about.html","locator":"MuPDF basis, product boundaries, Office caveats and licensing","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/installation.html","locator":"Wheels, native compilation, legacy fitz package collision and platform limits","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}]}],"evidence":[{"url":"https://pymupdf.readthedocs.io/en/latest/about.html","locator":"MuPDF basis, product boundaries, Office caveats and licensing","retrievedAt":"2026-10-07T13:43:28Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://pymupdf.readthedocs.io/en/latest/about.html","locator":"MuPDF basis, product boundaries, Office caveats and licensing","retrievedAt":"2026-10-07T13:43:28Z","id":"about","title":"PyMuPDF features and licensing","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/how-to-open-a-file.html","locator":"File recognition, formats and remote byte streams","retrievedAt":"2026-10-07T13:43:28Z","id":"open","title":"Opening documents","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/recipes-ocr.html","locator":"Separate Tesseract dependency, hidden text and reusable TextPage","retrievedAt":"2026-10-07T13:43:28Z","id":"ocr","title":"Integrated OCR","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/recipes-multiprocessing.html","locator":"Unsupported multithreading and process-based handling","retrievedAt":"2026-10-07T13:43:28Z","id":"parallel","title":"Multiprocessing guidance","kind":"vendor"},{"url":"https://pymupdf.readthedocs.io/en/latest/installation.html","locator":"Wheels, native compilation, legacy fitz package collision and platform limits","retrievedAt":"2026-10-07T13:43:28Z","id":"install","title":"Installation","kind":"vendor"},{"url":"https://pypdf.readthedocs.io/en/stable/","locator":"Python page manipulation and text extraction","retrievedAt":"2026-10-07T13:43:28Z","id":"pypdf","title":"pypdf overview","kind":"vendor"}],"overviewCitations":["about"],"licenseCitations":["about"],"sections":[{"id":"inputs","heading":"Opening and recognizing documents","paragraphs":[{"id":"inputs-detail","content":[{"text":"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."}],"citations":["open"]}]},{"id":"ocr","heading":"Scanned content","paragraphs":[{"id":"ocr-detail","content":[{"text":"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."}],"citations":["ocr"]}]},{"id":"concurrency","heading":"Concurrency and packaging","paragraphs":[{"id":"concurrency-detail","content":[{"text":"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."}],"citations":["parallel","install"]}]},{"id":"formats","heading":"Edition and compatibility boundaries","paragraphs":[{"id":"formats-detail","content":[{"text":"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."}],"citations":["about","open"]}]},{"id":"choice","heading":"Licensing and substitution","paragraphs":[{"id":"choice-detail","content":[{"text":"PyMuPDF is available through AGPL or commercial licensing. It can substitute for selected "},{"text":"pypdf","targetSlug":"pypdf"},{"text":" 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."}],"citations":["about","pypdf","install"]}]}]},"id":"Q572","revision":620,"updatedAt":"2026-10-12T23:07:35Z","sourceUrl":"https://substitutefor.net/entities/Q572?revision=620"}}