Display complex PDF documents with MuPDF
PDF on Steroids
PDFs with many hundreds of pages and equal numbers of images can easily bring PDF viewers such as Okular or Evince to their knees. In contrast, MuPDF puts even the thickest digital tomes on your screen in the blink of an eye.
You might be familiar with this situation: You want to view a PDF document, but as soon as you load it or you try to view the first page on less than state-of-the-art hardware, your favorite PDF viewer slows to a crawl. Even a modicum of scrolling in the document totally overtaxes the system.
This typically happens with PDF documents containing a large number of pages and many charts and images. The PDF viewers typically delivered with a Linux distribution (e.g., Evince or Okular) soon reach their limits. In such cases, it's time to switch to MuPDF [1]. This lean and powerful document viewer displays not only PDF-formatted documents but also XPS, OpenXPS, and CBZ files.
The Contenders
MuPDF's appearance may be a little plain, but even rendering large PDF files is unlikely to faze the tool (Figure 1). MuPDF does not just scroll quickly through documents that are difficult to render, it also displays the content in a far crisper way than its competitors. The test object in our lab was the art e-book Radiant Identities by US photographer Jock Sturges [2]. On Debian and Fedora, I used the PDF viewers Okular, Evince, Xpdf, and QPDF in addition to MuPDF. The hardware in the lab was a well-equipped workstation and – for comparison's sake – an entry-level laptop by HP.
Most PDF viewers on Linux use the Poppler [3] library to render PDF documents. As a dynamic library, Poppler is designed to leverage the capabilities of state-of-the-art desktop systems. Its disadvantage is inadequate processing speed for large, graphically complex PDFs. That's one reason why you should give MuPDF a chance. And, most Linux distributions have the application in their package sources, so the installation can typically be handled conveniently using the distro's package manager.
State of the Art
In terms of speed, MuPDF definitely impresses, using its own renderer, called pdfdraw-mupdf
, and its own graphics library, dubbed Fitz. The focus in developing these libraries was primarily on speed and precision: Fitz computes anti-aliasing right down to the subpixel level, whereas other libraries stop at the pixel level. This ensures entirely crisp rendering and fast speed.
MuPDF can handle the current PDF 1.7 standard, and it supports searching, transparency, encryption, hyperlinks, and comments through built-in modules. As of version 1.2, MuPDF also supports form completion and JavaScript execution. The available MuPDF viewers for Linux, Mac OS X, and Windows and the apps for Android and iOS [4] are simply examples of what MuPDF is capable of. The modular design and the portability of the code make it possible to integrate MuPDF into other applications. For example, the Sumatra PDF program for Windows [5] and Zathura [6] for Linux are based on MuPDF.
Controls
MuPDF is launched at the command line by appending the PDF document to open, and the entire path, as in:
mupdf </path/to/example>.pdf
In Fedora, the basic command is mupdf-x11
. Various hot keys and keyboard shortcuts (see Table 1) let the user control the view, set bookmarks, and scroll through the document. The viewer does not have a graphical toolbar or a sidebar with thumbnails.
Table 1
Keyboard Shortcuts
Key | Function |
---|---|
+ or = |
Zoom in |
- |
Zoom out |
Page-Down or . |
Next page |
Page-Up or , |
Previous page |
> |
Forward 10 pages |
< |
Back 10 pages |
Shift+L |
Rotate page counterclockwise |
Shift+R |
Rotate page clockwise |
<number>g |
Go to specified page number |
m |
Add bookmark |
t |
Go to bookmark |
/ |
Search |
n, N |
Find next |
Shift+N |
Find previous |
w |
Shrink window to match document size |
Alt+Q |
Quit MuPDF |
The man page for MuPDF [7] lists a number of additional parameters, some of which you can append to the start command. For example, you can define the resolution at which MuPDF opens the document or modify the way fonts are displayed to suit your own requirements by adapting the anti-aliasing. That said, however, MuPDF is a viewer-only program and does not offer a print function.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.