Fit-to-page extension for DocViewMode
What’s this?
Fit-to-page extension for DocViewMode is a simple extension for DocViewMode. It allows PDF/PS images to fit to a Emacs buffer. This emacs lisp works for Emacs 23 or later.
Screenshots
- Just after opening a PDF in DocViewMode
- Push ‘h’ key and call ‘doc-view-fit-height
- Push ‘w’ key and call ‘doc-view-fit-width
- Push ‘f’ key and call ‘doc-view-fit-page
Installation
- Download doc-view-fit-page.el
- Put it in a directory with load-path
\M-x byte-compile-file [RET] /path/to/doc-view-fit-to-page.el [RET]
- Add the setting below on .emacs
(require 'doc-view-fit-page) (add-hook 'doc-view-mode-hook '(lambda () (local-set-key "f" 'doc-view-fit-page) (local-set-key "w" 'doc-view-fit-width) (local-set-key "h" 'doc-view-fit-height)))
Use it!
- Open a PDF or PS file by \C-x \C-f (find-file)
- If you opened PS file and texts are displayed, you need to type \C-c \C-c (doc-view-mode-toggle-display)
- Type ‘f’, ‘w’, or ‘h’ key and enjoy Fit-to-page extension for DocViewMode!
Follow Me on Twitter
I’m on @laysakura waiting for you!