LinuxCommandLibrary

mupdf

View PDF, XPS, and Ebook documents

TLDR

Open a PDF on the first page

$ mupdf [path/to/file]
copy

Open a PDF on page 3
$ mupdf [path/to/file] [3]
copy

Open a password secured PDF
$ mupdf -p [password] [path/to/file]
copy

Open a PDF with an initial zoom level, specified as DPI, of 72
$ mupdf -r [72] [path/to/file]
copy

Open a PDF with inverted color
$ mupdf -I [path/to/file]
copy

Open a PDF tinted red #FF0000 (hexadecimal color syntax RRGGBB)
$ mupdf -C [FF0000]
copy

Open a PDF without anti-aliasing (0 = off, 8 = best)
$ mupdf -A [0]
copy

SYNOPSIS

mupdf [options] file [page]

PARAMETERS

-A bits
    Set the anti-aliasing bits for rendering (e.g., 0, 4, 8).

-C file
    Load a specified colorspace profile.

-F name
    Specify an alternative font file to use for rendering.

-I file
    Invert the colorspace, often used for a 'night mode' effect.

-N res
    Set the default resolution for rendering documents.

-O string
    Provide the owner password for encrypted documents.

-S name
    Load a stylesheet for EPUB or HTML documents.

-W file
    Specify a font substitution file.

-X xres
    Set the X-axis resolution for rendering.

-Y yres
    Set the Y-axis resolution for rendering.

-c file
    Specify a client certificate file for secure connections.

-f fit
    Set the initial page fit mode (e.g., 'width', 'height', 'whole').

-i interval
    Set the slideshow interval in seconds for automatic page advancement.

-l
    List all available fonts detected by MuPDF.

-o output
    Specify an output filename, typically for conversion tasks.

-p password
    Provide the user password for encrypted documents.

-r angle
    Rotate the initial page view by a specified angle (e.g., 90, 180, 270).

-v
    Display the MuPDF version information and exit.

-z zoom
    Set the initial zoom level as a percentage (e.g., 100 for 100%).

-q
    Suppress informational messages, running in quiet mode.

-x
    Disable X11 display, forcing text-mode output or conversion.

DESCRIPTION

MuPDF is a free and open-source software suite primarily used for viewing and processing various document formats, including PDF, XPS, EPUB, FictionBook, and comic book archives (CBZ, CBR). It is renowned for its lightweight nature, exceptional speed, and strong emphasis on security. Unlike many feature-rich document viewers, MuPDF prioritizes rendering accuracy and performance, making it an excellent choice for systems with limited resources or for users who prefer a minimalist interface. Its rendering engine is also widely used in other applications and libraries due to its robust and efficient design. MuPDF supports advanced features such as searching, text selection, and annotation viewing, although the graphical interface remains intentionally simple. It also includes command-line tools for document conversion and manipulation, extending its utility beyond simple viewing.

CAVEATS

MuPDF's minimalist design means some advanced GUI features (like complex annotation tools or extensive toolbar customization) are often handled via keyboard shortcuts rather than explicit menu options. While generally robust, rendering of highly complex or malformed documents might sometimes vary compared to other engines. For very large documents, memory usage can still be significant, especially with high anti-aliasing settings.

KEY BINDINGS

MuPDF is heavily reliant on keyboard shortcuts for navigation and interaction. Common bindings include: j/k for next/previous page, +/- for zoom in/out, / for search, q to quit, and r to reload. Users are encouraged to consult the program's manual page (man mupdf) for a complete list of shortcuts.

COMMAND-LINE UTILITY

Beyond interactive viewing, MuPDF provides powerful command-line capabilities for document manipulation through companion tools like mutool (often shipped with MuPDF). mutool allows for conversions between formats (e.g., PDF to PNG, PDF to text), document merging, splitting, and encryption/decryption, making it a versatile backend for automated document processing workflows.

HISTORY

MuPDF was originally developed by Artifex Software Inc., a company renowned for its Ghostscript interpreter. It was designed from the ground up to be a lightweight, high-performance, and secure alternative for rendering PDF and XPS documents. Its development emphasized a small code footprint and efficient parsing and rendering, aiming to avoid the complexities and security vulnerabilities often associated with larger, more feature-rich document processing libraries. Over time, it has expanded its support to cover various other formats, while steadfastly maintaining its core philosophy of speed and security.

SEE ALSO

evince(1), okular(1), zathura(1), xpdf(1), less(1)

Copied to clipboard