create new tag
view all tags

MuPDF App Design

This is a proposal for the design requirements of a new MuPDF mobile app.


When you open the app, we should show a simple file chooser.

When opening a document either via "Open with..." in another app, or from inside our file chooser, we go directly to the document view mode. There should not be a separate 'document preview' mode like in SmartOffice -- we're a viewer not a document editor so this is just a needless confusing mode.

We should allow multiple documents to be open at the same time, so opening a document should launch a new activity rather than replacing the old one.

There should be a full screen 'read only' mode that you can toggle, which hides all the UI chrome and shows only the page contents. This can behave like the Kindle device and other e-readers: tapping on the left or right third of the screen goes back and forward a page (or vice versa in RTL mode), tapping on center of the screen brings the UI back. Hiding the UI could be done by a tap in the middle, or by hitting an icon in the toolbar, but should be quickly and trivially accessible.

In landscape mode, consider putting the UI controls and toolbars in a panel on the right (or left) side of the screen, to allow the biggest number of lines on the page to be seen. Toolbars at the top take a lot of vertical space, which is at a premium.


The app should have two main display modes:

1) Continuous scroll, like a web page. In this view, you can scroll and zoom. On the right hand side of the page is a page scrubber, showing the page number and quickly letting you scroll to a given page.

In continuous scroll mode, the default zoom should be fit-to-width.

2) Paged mode. This behaves like the old app, where you swipe left and right to flip pages, and the page automatically centers itself on the screen when you let go. It would be nice if it had the fling ability and still auto-centered on a page when it stops.

The page scrubber should be at the bottom, matching the same direction of swiping left/right.

In paged mode, the default zoom should be fit-to-page.

Paged mode need a toggle for right-to-left reading. This is used in RTL languages and also for manga comic books.


Paged mode could have an option to show two pages spread side-by-side, showing facing pages. Flipping to the next/previous page would go to the next/previous spread. This facing mode would need a few more options if implemented:

  • Even or odd start page.
  • Treat landscape pages as a full spread.


The page scrubber should use fisheye magnification without page thumbnails. This lets us get both precision when settling down on the desired page number, but we can still navigate quickly to far away pages.


Following links should be pushed on the navigation stack so that the 'back' button goes back to the previous location.

The app should remember the navigation history per document, so if you quit and open a document later, you can continue reading from where you left off, and also keep the navigation history.

See the "MuPDF mini" viewer for an example of how it could behave.

Better would be having explicit back/forward buttons in the UI so it can behave like mupdf-gl.


The table of contents should be easily accessible. When selecting a chapter to jump to, we should remember the previous location so that if the user hits back, we go back to where she was reading before.


We should allow the user to create bookmarks for pages, and quickly jump to previously created bookmarks. I suggest a menu that at the top has a command to create (or delete) a bookmark on the current page, and then a list of all the bookmarks in the document for jumping to them.

Bookmarks should be saved separately from the document to not require saving. When opening a document with bookmarks they should be dropped if the document contents has changed while MuPDF was closed.


We should have some way to select text. I suggest a long tap to start selecting.

When you have selected the text, the user should be provided a few options:

  • Copy to clipboard
  • Look up the word in a dictionary
  • Look up the text on wikipedia
  • Search for the text in the current document
  • Create a markup annotation (in PDF documents)


There should be a search UI, where the user can enter some text and search up/down. The selections should be visibly highlighted and scrolled to.

See the "MuPDF mini" viewer for an example of how it could behave.


PDF documents can have annotations/comments, so we should have controls in the UI for creating and editing annotations.

This will also necessitate adding 'Save' and 'Save as...' items in a file menu.

There are two main types of annotations: objects, drawing, and markup.

The 'object' type annotations are:

  • Text,
  • Stamp,
  • Square,
  • Circle,
  • Line.

The 'drawing' type annotations are:

The 'markup' type annotations are:

  • Highlight,
  • Underline,
  • Strike-out,
  • Squiggly,
  • Redact.

Creating a new 'object' type of annotation, we should just place it in the top left corner of the page and pre-select it for further edits (such as dragging it to a new location).

Drawing type annotations need a drawing UI -- Ink is freehand that we already do, PolyLine /Polygon need a polygon editor where you can add new line segments or drag to move existing vertices, and a button to delete a vertex.

To create markup type annotations, the user should first select some text, and can then create an annotation from the selection.


PDF documents can have forms that should be able to be filled out. This should mostly be done in-line on the page without bringing up extra dialogs to fill in the contents:

  • Push Buttons, Checkboxes, and Radio buttons should be tappable.
  • Text fields and combo boxes should be editable.
  • Combo boxes and Choice boxes should have a pop-up menu to select options.
  • List boxes should be scrollable, and (de)select items by tapping.
  • Digital signatures should bring up a dialog to verify or sign.


Reflowable documents like EPUB, FB2, and XHTML have flexible page sizes. For these document types we should layout the document to fit the current screen size, minus any furniture, so that full screen reading will show one page on the screen at a time, or two facing pages in paged landscape mode giving so two columns of text show at a time.

We should also add a 'formatting' dialog to reflowable documents with the following options:

  • Text size
  • Font family
  • Line spacing
  • Margins
  • Justification.
  • Disable publisher styles
  • Use custom "book like" style

If we disable publisher styles, the HTML document will be very plain with blanks between each paragraph. We can provide a better style sheet that should provide a consistent book-like look, but this will only work for relatively well formed documents so should be an option.

Note that bookmarks and history locations in reflowable documents can't be page based -- they need to use the fz_make_bookmark and fz_lookup_bookmark functions to map a location to a page number. TODO: how to persist fz_bookmark in history and settings -- currently they are just an opaque pointer into an internal structure of the document. We may need to go to persistent integer locations instead.

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2019-06-11 - TorAndersson
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc