20.3 Standard Document Handlers

MuPDF contains a range of document handlers for different formats. Which of these are built/enabled by default depends on configuration options in the include/mupdf/fitz/config.h file. See chapterĀ 18 Build configuration for more information.

20.3.1 PDF

Support for PDF (Portable Document Format) is provided by pdf_document_handler. All current versions at the time of writing (i.e up to and including PDF 2.0) are supported.

MuPDF contains functionality to allow deeper access to the contents and structure of a PDF file than is exposed through the standard fz_ prefixed functions, by using pdf_ prefixed functions.

The library provides a pdf_specifics function to safely promote a fz_document pointer to a pdf_document pointer. This will return NULL if the document is not a PDF, indicating that the pdf_ functions cannot be used.

20.3.2 XPS

Support for XPS (Open XML Paper Specification) is provided by xps_document_handler. All current versions at the time of writing are supported.

20.3.3 EPUB

Support for EPUB v2 is provided by epub_document_handler. Tables are not currently supported, but is planned. Support for v3 is not planned.

The same document handler supports the FB2 (Fiction Book 2) electronic book format.

20.3.4 HTML

Support for basic HTML + simple CSS is provided by htdoc_document_handler. Tables are not currently supported, but is planned.

20.3.5 SVG

Support for SVG (Scalable Vector Graphics) is provided by svg_document_handler. Support is incomplete, but sufficient for many files.

20.3.6 Image

Support for a range of common image types (including PNG, JPEG, TIFF, JPEG2000, BMP and GIF) is provided by image_document_handler.

20.3.7 CBZ

Support for CBZ (Comic Book Archive) format is provided by cbz_document_handler. This supports files in .zip or .tar format.