Today I wrote an extension for emacs that lets you view pdf, ps or dvi documents in emacs. It’s named doc-view.el and I posted it to the emacs-sources mailing list (here it is). But I recommend that you get the latest version by cloning my Git repository.
A description of doc-view.el and how to get it can be found on my homepage.
UPDATE: doc-view is official part of Emacs and the default viewer for DVI and PDF files.
Wow, cool! I’ve been learning and learning elisp for so long that I didn’t learn at all hehe.. But here, you have done it! nice :) I’ll use it and come back.
Thanks a lot for the compliments!
Bye,
Tassilo
Great add-on :)
ive been using it for a while and im missing only one thing. Rescaling images. Sometimes the pdf doc’s don’t fit in the window.
Pablo
With the doc-view version in Emacs CVS (23), you can enlarge and shrink the doc with + and -.
This is very nice. I’ve been thinking of writing a similar reader that uses pdftotext for emacs buffer viewing, although there are obvious limitations. It would be nice to see a mode that allows options for conversion to text, tex, and png. The problem with png is that the file is no longer searchable. Maybe one day there will be a conkeroresque pdf viewer ;)
Hey Fred,
doc-view allows both conversion to text (simply hit C-c C-t when viewing the doc as PNG images), and searching (C-s and C-r, mimicing the isearch behavior).
Bye,
Tassilo
C-c C-t does not show the document source – it just shows document text (which is frustrating). How can I fix disable doc-view.el so I can actually see the pdf document source?
Simply switch to fundamental-mode: M-x fundamental-mode RET
Can I disable DocView altogether? It’s inconvenient to have to manually switch to fundamental-mode every time I need to look at the beginning of a PDF.
With Doc files I’m much more interested in hexlify-buffer than rendering. I have other tools to do that. Thanks!
Sure, simply remove its entry from auto-mode-alist:
(setq auto-mode-alist(remove '("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
auto-mode-alist))
However, if you generally want to see pdf files and other docs in a hex editor, then I’d just add a new (overriding) entry that enables emacs’ hex editor (hexl-mode):
(add-to-list 'auto-mode-alist'("\\.\\(?:PDF\\|DVI\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|docx?\\|xlsx?\\|pptx?\\)\\'" . hexl-mode))
Bye,
Tassilo