Skip to content
Back to top

# What is MuPDF?

MuPDF is an open source software framework for viewing, converting, and manipulating PDF, XPS, and E-book documents. There are viewers for various platforms, several command line tools, and a software library for building tools and applications.

## Formats

As you can tell by the name, we support reading PDF files. But that’s not all!

- PDF

- XPS and OpenXPS

- EPUB (DRM-free 2.0, limited support for 3.0)

- Mobipocket (MOBI)

- FictionBook 2 (FB2)

- ComicBook (CBZ and CBT)

- Images (TIFF, JPEG, PNG, etc)

- SVG (a limited subset only)

## Viewers

There are many different viewer applications that build on the MuPDF library for a large variety of platforms.

### Linux, Windows, and BSD

For Linux and Windows there are two viewer applications. The main viewer (mupdf-gl) has many features such as a table of contents sidebar, full unicode search, annotation editing, redaction, etc. On systems where this viewer cannot be built, we still support the older legacy viewer which does not have as many features.

mupdf-gl
  The main viewer program that sports the most features.
mupdf-x11
  The legacy X11 viewer that works everywhere.
mupdf-win32
  The legacy win32 viewer for Windows.

### Android

Android currently has two different viewers with varying degrees of complexity:

MuPDF viewer
  A high performance PDF viewer with a smooth and polished interface.
MuPDF mini
  An example of how to create a PDF viewer with the least amount of code.

### Web Browser

There’s a simple WebAssembly demo that runs MuPDF in the browser.

There’s also a commercial license only MuPDF WebViewer product.

### Third party viewers

Here’s a non-exhaustive list of other non-affiliated open source projects that use MuPDF:

- SumatraPDF for Windows

- Zathura for Linux

- llpp

## Command Line

The command line tools are all gathered into one umbrella command: mutool. This swiss army knife has a lot of sub-commands for performing different tasks on PDF documents.

For rendering and converting documents use these two commands:

mutool draw
  This is the more customizable tool, but also has a more difficult set of command line options. It is primarily used for rendering a document to image files.
mutool convert
  This tool is used for converting documents into other formats, and is easier to use.

A highlight of some other tools useful for working with PDF documents:

mutool show
  A tool for displaying the internal objects in a PDF file.
mutool extract
  Extract images and embedded font resources.
mutool clean
  Rewrite PDF file. Used to fix broken files, or to make a PDF file human editable.
mutool create
  Create a new PDF file from a text file with graphics commands.
mutool merge
  Merge pages from multiple input files into a new PDF.
mutool poster
  Divide pages of a PDF into pieces that can be printed and merged into a large poster.

And finally, there is a tool for doing anything you can imagine:

mutool run
  A tool for running Javascript programs with access to the MuPDF library functions.

## Library

The library is written in portable C.

To learn more about the C interface, read the MuPDF Explored book.

### Javascript

There is a library available to use MuPDF from Javascript and Typescript, powered by WebAssembly. You can use this library to build applications that run in a web browser, or that run server side using Node or Bun.

The Javascript library is available as a module on NPM.

### Java

There is also a Java library, which uses JNI to provide access to the C library.

The Java classes provide an interface very similar to that available in the mutool run command line tool. This Java library also powers the Android viewers.

If you want to build an application for Android, you have several options. You can base it off one of the existing viewers, or build a new app using the Java library directly.

### Python

The popular PyMuPDF library makes it trivial to use MuPDF from Python!