When I open pdf with emacs, it got frozen. And I installed pdf-tools, open pdf, it got frozen again.
What's the underlining process when emacs open a pdf? Is there a lot of converting work? What should I do to speed it up?
- Emacs 24.4
- Ubuntu 14.04 LTS
- Intel 2.4GHz x 2
- 4G RAM.
Update:
I just found this page:
"learnt a lesson. Never open a pdf in emacs. Never even do it accidentally."
https://twitter.com/ergoemacs/status/456088661059457024
It's a sad news to me! Isn't it a great idea to view pdf using Emacs?
Update 2
I thought it was because my pdf file is too large:
5.7M, 1313 pages
So I tried a small pdf file,
402K, 66 pages
it got frozen again.
Update 3
I open pdf file using C-c C-x from helm, and it opens the pdf file in an external viewer: zathura. Since there is no converting process, the file opens lighting fast. (As fast as mupdf. I guess zathura using mupdf as its back end.)
There are four points makes zathura outstanding:
- Lighting fast. (Both open and search)
- High quality display.
- Tab displays the chapter/section menu just like Adobe Reader.
- Good keyboard shortcuts support. (Actually, it uses vim-style keybinding, which make sense since there is no need to switch mode in pdf viewer.
Update 4
Screen shot for quality comparasion:
!Left: Zathura; Right: PDF in Emacs
I really got confused what Emacs uses for open PDF. (I've already removed pdf-tools)
linum-modeenabled when opening PDF? – Tu Do Dec 24 '14 at 09:50emacs -Qagain. – wasamasa Dec 24 '14 at 09:53linmu-modeand restart emacs. Open the pdf, a poor quality pdf displayed. and the plating message says:Page 21 of page 1312 (Still converting...). – Nick Dec 24 '14 at 09:58pdf-view-mode, it gives better quality, render faster and always resize to full buffer where the PDF file is opened. – Tu Do Dec 24 '14 at 10:05emacs -Q, open the pdf file again. It open the PDF file with poor quality. Yes, this time, no frozen. I saw it is in DocView mode. How can I use pdf-view-mode? – Nick Dec 24 '14 at 10:15pdf-toolsusingel-getand I saw the message thatpdf-toolsis successfully installed. Before I build it again, I would like to ask the way Emacs display PDFs: Does it convert it to image first? That is, it doesn't display pdf, it display image? – Nick Dec 24 '14 at 13:43pdf-tools, you have to clone the repo, run./autogen.shand follow the standard procedure:./configure&&make&&sudo make install. Then, it will produce apdf-tools.tar.gzin the pdf-tools directory you cloned. Then, put(pdf-tools-install)somewhere in your init file. From now on, Emacs will usepdf-view-mdoewhich gives better quality and better rendering speed. – Tu Do Dec 25 '14 at 15:26pdf-toolsfrom scratch. It works! Both of the opening speed and display quality is almost identical tozathura. This is really exciting! Thank you very much. The only problem is the search. By default, it uses incremental search. The search hangs several times. I have to wait for it to stop. What kind of search do you use? – Nick Dec 26 '14 at 07:54