Docview

docview is a built-in document viewer for Emacs that can display dvi, ps, and pdf files. It isn’t as good as most PDF readers, but in a lot of cases it’s good enough without having to switch to a different application. It works by converting the files to a series of ‘png’ images, one per page, which Emacs can display. This means that you can’t edit them or copy text from PDF files, but if you only need to view them it works.

docview is enabled by default in emacs - opening a pdf file as a normal file will turn on docview-mode. The only customization I currently have for it is to turn on auto-revert for pdf files; I use this when creating a PDF file using latex and wish it to be auto-updated. There’s not much else I can think of that would improve this mode by the use of hooks - mostly to make it better Emacs would need native PDF support.

(add-hook 'doc-view-mode-hook 'turn-on-auto-revert-mode)

Using docview is fairly simple: n/p will move to the next or previous page and C-n/C-p moves up or down on the current page. You can zomm in and out with + and - respectively. Other normal movement keys are rebound to something appropriate - M-> will go to the last page, for example. You can also search for text with ‘C-s’ and ‘C-r’, but this will only take you to the correct page and message you the line the text is on - it won’t highlight the text for you, so it is rather subpar.

Tags:

3 Responses to “Docview”

  1. Rafal says:

    How to make it working on Windows?

  2. Tassilo says:

    I never tried it on windows, but at least you need gs (ghostscript) in your PATH. For PS and DVI files, you also need ps2pdf and one of dvipdf or dvipdfm. For searching, you need pdftotext.

  3. Ronnie says:

    Dont know if its just me, but try it on larger pdf (50+ pages) as it locks up emacs, Its a nice idea but it didnt really satsify me, the auto-updates pretty nice thou

Leave a Reply