How artifexsoftware/mupdf works
MuPDF is a document framework for viewing and converting PDF, XPS, and ebook documents. Its principal workflow is to open a document, interpret or lay out its content, then render or convert it. The tree also shows PDF-specific editing and signing, text search, and bindings for several platforms. The README documents the product scope; sampled source is incomplete, so links among format handlers and rendering stages are shown as unverified rather than asserted as observed calls.
Main entry points: fitz.h Fitz API · device.h Rendering devices · pdf PDF engine · html HTML and EPUB
Components 21
Document core
- Fitz API
include/mupdf/fitz.h - Runtime context
source/fitz/context.c
Document formats
- PDF engine
source/pdf - HTML and EPUB
source/html - XPS engine
source/xps - SVG engine
source/svg/svg-run.c - Comic archives
source/cbz/mucbz.c - PDF annotations
include/mupdf/pdf/annot.h - PDF signing
source/helpers/pkcs7/pkcs7-openssl.c
Content processing
- Document reflow
source/reflow/reflow-doc.c - HTML layout
source/html/html-layout.c - Text extraction
include/mupdf/fitz/structured-text.h - Text search
source/fitz/stext-search.c - Rendering devices
include/mupdf/fitz/device.h - Document output
include/mupdf/fitz/writer.h
User interfaces
- Desktop viewer
platform/gl/gl-main.c - X11 viewer
platform/x11/pdfapp.c - JavaScript bindings
source/tools/murun.c - WebAssembly API
platform/wasm/lib/mupdf.ts - Java bindings
platform/java/jni/context.c
Other components
- Document user
Connections 22
- Document user → Fitz API: uses framework
README - Fitz API → PDF engine: opens PDF
source/pdf/pdf-xref.c - Fitz API → XPS engine: opens XPS
source/xps/xps-path.c - Fitz API → HTML and EPUB: opens ebooks
source/html/html-layout.c - HTML and EPUB → HTML layout: lays out content
source/html/html-layout.c - PDF engine → Rendering devices: renders pages
- XPS engine → Rendering devices: renders pages
- HTML and EPUB → Rendering devices: renders pages
- SVG engine → Rendering devices: renders graphics
- Comic archives → Rendering devices: renders pages
- Rendering devices → Text extraction: extracts text
include/mupdf/fitz/structured-text.h - Text extraction → Text search: searches text
- Fitz API → Document output: converts documents
- PDF engine → PDF annotations: supports annotations
- PDF engine → PDF signing: signs documents
- Document user → Desktop viewer: views documents
- Document user → X11 viewer: views documents
- Document user → JavaScript bindings: uses bindings
- Document user → WebAssembly API: uses bindings
- Document user → Java bindings: uses bindings
- Runtime context → Fitz API: provides runtime
source/fitz/context.c - Document reflow → HTML and EPUB: reflows content