Paper Mode

Project status: abandoned due to linking problems with mupdf

Experimental PDF viewer for Emacs, rendering with mupdf and using gtk directly on an Emacs window from a dynamic module - the method invented by emcas-webkit.

Usage

Install:

To build the shared object you’ll need: mupdf 1.17+ dev version, gtk3 dev version. It should work with Emacs 27.

  1. Clone the repo
  2. Run make
  3. Add repo dir to load path

Alternatively, install through Guix with guix package -f paper-mode.scm

Config

With use-package:

(use-package paper
  ;; you could also add html, png, jpg
  :mode ("\\.pdf\\'"  . paper-mode)
  :mode ("\\.epub\\'"  . paper-mode)
  :mode ("\\.cbz\\'"  . paper-mode)
  :config
  (require 'evil-collection-paper)
  (evil-collection-paper-setup))

Todo list

  • [-] Outside Emacs
    • [X] Ensure zoom & rotation work
    • [X] Scroll
    • [X] Show more than one page at a time
    • [-] Mouse:
      • [ ] Smooth scrolling like Evince has
      • [X] Select text over multiple pages
      • [X] Links:
        • [X] Highlight on hover
        • [X] Show destination in a mousce hover popup kinda thing
        • [X] Follow internal links on click
    • [X] CANCELED Lazy load page text
    • [X] Free previous pages
    • [X] Pre render next page on idle time
    • [X] Real multithreaded page loading
    • [ ] Synctex
  • [-] Inside Emacs
    • [ ] Sensible page dimensions by default: Center with a fixed width if the window is too long, fit to width if sensible, calculate minimum width with fz_new_bbox_device if too small.
    • [-] Evil controls. I can’t do Emacs-style keybinds myself.
    • [ ] Follow links external to the document
    • [-] Search
      • [-] Normal
      • [ ] With a swiper-like preview of the results
    • [ ] Imenu to show PDF outline/bookmarks
    • [ ] Change bg & fg colors to comply with the Emacs theme, pdf-midnight-mode
    • [ ] Opening PDFs with passwords
    • [ ] Ace link selection
    • [ ] pdftotext view
    • [ ] extract/open embedded files
    • [ ] Annotations with text editing through Emacs
    • [ ] Support for bookmark.el and org-store-link, saving page & scroll & zoom
    • [ ] Accel files
    • [ ] Better Epub control, generate CSS mimicknig the Emacs theme. Could use htmlize’s face-to-css-spec.
    • [ ] Keybind to show PDF properties
    • [ ] Save scrolled document location to restore it on future openings
    • [ ] Figure out if I could map long key presses from Emacs to scroll smoothly continously
    • [ ] Presentation mode