Of course I already know about https://github.com/politza/pdf-tools.

I am on Emacs 24.5.1.

I am not convinced that doc-view is using mudraw/mupdf for pdf files.

(require 'doc-view)
(print doc-view-pdfdraw-program)



However, the following screenshot says otherwise:

emacs doc-view vs zathura with mupdf

Emacs using doc-view on the left, zathura with mupdf backend on the right. Same pdf file, zoomed by hand to approximately the same level. The pdf is here.

As you can see, in the sentence starting with "For instance" for example, the superscript p, and the subscript n are much clearer in zathura. In doc-view, the n in particular is barely readable, if at all, even at this level of zoom.

I am obviously missing something, but not sure what.

(setq doc-view-pdf->png-converter-invocation

from http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164 does not seem to work.

The official documentation does not say much. Searching for answers comes up with that mupdf should be automatically used if it exists. I am on archlinux and have the official ghostscript and mupdf packages installed. The strange thing is (print doc-view-pdfdraw-program) still outputs "mudraw" even after I uninstall the official mupdf package (and after restarting emacs), although this is likely irrelevant.

If you the reader is successfully using mudraw/mupdf with doc-view, then perhaps you might want to download that pdf (and install zathura temporarily) and test out the quality you see in each program. If you see the same or similar thing as my screenshot, perhaps there is no problem here.

Perhaps the mupdf being used by zathura is actually different than the original one/the one doc-view uses. If I recall correctly, zathura uses its own slightly patched version of mupdf. However, my understanding was that zathura slightly patches it so that it works better with zathura itself, not necessarily patching the rendering parts themselves. This comment also seems to suggest that there should be very little, if any, differences between the rendering qualities (and speeds) between doc-view using mudraw/mupdf and zathura with mupdf backend.

  • 1
    Try to run mudraw with the same arguments as docview does, and compare the quality of the resulting image. – lunaryorn Jul 5 '15 at 12:31
  • How do I use mudraw? For example I used mudraw -o euclid.png euclid.pjm.1102986512.pdf but the euclid.png file is just a blank (white) page. – rws Jul 5 '15 at 12:34
  • 2
    Okay I set the resolution better, to 300 using the -r option. i.imgur.com/P9kK9Sj.png. So (setq doc-view-resolution 300) is the solution. (After (doc-view-clear-cache).) – rws Jul 5 '15 at 12:46
  • 1
    Please turn your last comment into an answer and accept it, to help other users which have the same problem. – lunaryorn Jul 5 '15 at 12:47
  • 1
    For the record I've settled on a dpi of 144 because it seems to be a tradeoff between speed and quality. – rws Jul 5 '15 at 12:56

The default resolution is probably around 90 dpi.

(require 'doc-view)
(setq doc-view-resolution 144)

(Or set higher as you need.)

You may need to run doc-view-clear-cache first for the change to be respected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.