reddit / emacs
Why is the Emacs PDF and Image Viewer so bad?
[deleted] · 2022-03-07 00:18
[deleted]
oantolin · 2022-03-07 00:33
If you're talking about the builtin DocView for PDF's, you should give pdf-tools a shot.
Primary-Wave2 · 2022-03-07 00:40
I tried pdf-tools, but pdf tools seems to work by generating an image from the PDF and displaying that.
When zooming in, pdf-tools has quality issues unless you increase the image resolution in your init, which will in turn increase loading times.
(And even with the pdf-tools approach, using the default gnome document viewer is so much snappier while also having a far better resolution)
7890yuiop · 2022-03-07 01:42
That sounds weird to me. Emacs with pdf-tools is the best PDF viewer on my system. Can you link to a (small, ideally) example PDF and detail how to observe the problem?
oantolin · 2022-03-07 01:47
> pdf tools seems to work by generating an image from the PDF
This is correct. I find it to be fast enough doing that, but I can imagine others having a different opinion. I guess it also depends on the kind of PDFs you typically view and what you do with them. For example, the ones I use are mostly papers, and I don't zoom in to them, just read. So pdf-tools works well for my use case, while it doesn't work well for yours.
I use pdf-tools for it's features, which I don't think Evince has (or at least it didn't many years ago when I used it):
- Quick start up time! Of course pdf-tools only wins here because I always have Emacs open, and Evince has to start up each time.
- The ability to crop to a tight bounding box.
- Text search with Perl compatible regexps.
- Keyboard link navigation, either by searching for part of the link text or by "link hints", putting a letter next to each link so you can select it with one keystroke.
- Midnight (inverted colors) mode.
- Jump to an entry from the table of contents selecting it from the keyboard via completion.
- Display the table of contents in a separate window where you can fold subsections.
- Great keyboard-centric support for adding and editing annotations, the only thing you have to with the mouse is select were to add a new annotation. I don't think I've ever used another PDF viewer where I can search among the text of my annotations!
Maybe the rendering is a little slow (but I don't find it slow at all), and maybe it's not great if you need to zoom in (which I basically never do), but for my use case (reading papers and annotating the hell out of students's theses) it is easily the best PDF viewer I've ever used.
chiraagnataraj · 2022-03-07 01:49
>I tried pdf-tools, but pdf tools seems to work by generating an image from the PDF and displaying that.
Nope, pdf-tools doesn't do this, you were still using docview.
>When zooming in, pdf-tools has quality issues unless you increase the image resolution in your init, which will in turn increase loading times.
Hmm...that also sounds like docview, not pdf-tools.
Primary-Wave2 · 2022-03-07 02:34
Revised everything and found out that I had a compilation error I didn't notice! Pdf tools works as intended now and is alot faster.
Very sorry for taking your time and thank you for the help!
oantolin · 2022-03-07 02:35
I didn't help! I just advertised. :P
oantolin · 2022-03-07 02:40
> Nope, pdf-tools doesn't do this
It does do that. It doesn't do it ahead of time like DocView and keeps the images in memory rather than in files like DocView, but it does create images (pngs, I believe) and then asks Emacs to display them.
ObjectiveNecessary61 · 2022-03-07 06:58
Try eaf-pdf-viewer. it is the best pdf viewer in emacs.
seregaxvm · 2022-03-07 08:59
Evince has an awesome feature of hover on link preview. It's great for math heavy books and papers.
ftrx · 2022-03-07 09:46
Essentially, at heart, the reason is that Emacs do not have a canvas, so it's very well capable of display/navigate/manipulate text, very little for images. `pdf-tools` with `pdf-continuous-scroll-mode` gives normally enough visual usage and comfort to be used by default/in most cases, it's support for annotations etc is good.
chiraagnataraj · 2022-03-07 11:33
You can annotate PDFs, select text, and generally do things that would be impossible or hard if pdf-tools rendered pngs of each file.
[edit] I stand corrected. It uses poppler to render pages and creates PNG files according to the readme. But there's also clearly a lot more going on beyond it dumbly rendering PDFs as PNGs.
oantolin · 2022-03-07 14:00
Just to be clear, I never said it rendered *dumbly*, nor did I say there was nothing else going on. I love pdf-tools and if you read my other comment on this post you'll see I extol it's features.
oantolin · 2022-03-07 14:08
That sounds nice but a little gimmicky and unnecessary. With pdf-tools you can follow a link with two key strokes (press `F` and it shows a letter next to each link that you press to follow the link) and then one more keystroke brings you back to where you were.
I bet this 3-keystroke approach is faster and more comfortable to use than the Evince feature you mentioned. Since links are often small targets, putting the mouse pointer on one is probably a little slow. And Evince probably doesn't pop up the preview immediately since that would be annoying if you're just moving mouse to somewhere else, so there's a further little delay. Finally, what if the preview doesn't have the entire text you need from the link destination, can you scroll the preview?
thewebmasterp · 2022-03-07 18:54
pdf-mode needs continuous scroll. Currently, [this](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwizp6SV1bT2AhUTSfEDHS-nCpEQFnoECAYQAQ&url=https%3A%2F%2Fgithub.com%2Fdalanicolai%2Fpdf-continuous-scroll-mode.el&usg=AOvVaw0wtPtY9InNkbX13K6AI80K) package implements it in a very dirty way... I really can't think of how someone would use a pdf viewer with that nasty scrolling, showing you only the next page, rather than allowing for a transition between the two pages.
oantolin · 2022-03-07 21:33
I know! What is this? A book? Unreadable! :P
assistanttevta · 2022-03-17 06:34
I have used PDF software in the days when most people did not know even what PDF meant. Nowadays there are so many PDF programs out there it is easy to get confused. With this in mind, I suggest you look for and consider [SwifDoo PDF](https://www.swifdoo.com/convert-to-pdf).