Desktop Viewer Manual
For Linux and Windows, there are two viewers. One is a very basic viewer using x11 and win32, respectively. It has been supplanted by a newer viewer using OpenGL for rendering, which has more features such as table of contents and Unicode search. The older viewers are accessible for systems where OpenGL is not available.
MuPDF OpenGL Viewer
The OpenGL based viewer can read PDF, XPS, CBZ, and EPUB documents. It compiles on any platform that GLFW supports. The latest release builds on Linux, Windows, and macOS.
Command Line Options
mupdf-gl [options] document [page]
-p password – The password needed to open a password protected PDF file.
-r resolution – Set the initial zoom level, specified as DPI. The default value is 72.
-W width – Set the page width in points for EPUB layout.
-H height – Set the page height in points for EPUB layout.
-S size – Set the default font size in points for EPUB layout.
-U stylesheet – Specify a CSS file containing user styles to load for EPUB layout.
-X – Ignore publisher styles for EPUB layout.
The middle mouse button (scroll wheel button) pans the document view.
The right mouse button selects a region and copies the marked text to the clipboard.
Several commands can take a number argument entered before the key, to modify the command. For example, to zoom to 150 dpi, type “150z”.
|i||Display document metadata.|
|o||Toggle display of outline.|
|L||Toggle display of links.|
|w||Shrinkwrap window to fit page.|
|W||Fit page width to window.|
|H||Fit page height to window.|
|Z||Fit page size to window.|
|[number] z||Set zoom resolution in DPI.|
|[arrows] or h, j, k, l||Pan page in small increments.|
|b||Smart move one screenful backward.|
|[space]||Smart move one screenful forward.|
|[comma] or [page up]||Go one page backward.|
|[period] or [page down]||Go one page forward.|
|<||Go 10 pages backward.|
|>||Go 10 pages forward.|
|[number] g||Go to page number.|
|G||Go to last page.|
|m||Save current page to navigation history.|
|t||Go back in navigation history.|
|T||Go forward in navigation history.|
|[number] m||Save current page in numbered bookmark.|
|[number] t||Go to numbered bookmark.|
|/||Start searching forward.|
|?||Start searching backward.|
|n||Continue searching forward.|
|N||Continue searching backward.|
MuPDF x11 and win32 Viewer
The latest development source is available directly from the git repository:
git clone --recursive git://git.ghostscript.com/mupdf.git
In the MuPDF directory, update the third party libraries:
git submodule update --init
Compiling on Windows
On Windows, there is a Visual Studio project file in:
Compiling on Linux
If you are compiling from source you will need several third-party libraries: freetype2, jbig2dec, libjpeg, openjpeg, and zlib. These libraries are contained in the source archive. If you are using git, they are included as git submodules.
You will also need the X11 headers and libraries if you’re building on Linux. These can typically be found in the xorg-dev package. Alternatively, if you only want the command line tools, you can build with HAVE_X11=no.
The new OpenGL-based viewer also needs OpenGL headers and libraries. If you’re building on Linux, install the mesa-common-dev and libgl1-mesa-dev packages. You’ll also need several X11 development packages: xorg-dev, libxcursor-dev, libxrandr-dev, and libxinerama-dev. To skip building the OpenGL viewer, build with HAVE_GLFW=no.
To install the viewer, command line tools, libraries, and header files on your system:
make prefix=/usr/local install
To install only the command line tools, libraries, and headers invoke make like this:
make HAVE_X11=no HAVE_GLFW=no prefix=/usr/local install