Skip to main content
Share Your Experience: Take the 2024 Developer Survey
46 votes
Accepted

How to use pdf-tools (pdf-view-mode) in emacs?

Switching from docview to pdf-tools happens 'automatically' when you install pdf-tools. Once you've done this, any time Emacs tries to open a pdf in Emacs, it will use pdf-tools. However, some ...
Tyler's user avatar
  • 22.3k
12 votes

pdf-tools: View multiple pages in one buffer - like evince's continous mode

It can't do that. I have some ideas about how to implement this, but nothing has materialized yet.
politza's user avatar
  • 3,346
10 votes
Accepted

Is it possible to export highlighted text with pdf-tools?

I don't know if it is possible with pdf-tools, but it is possible with org-noter (https://github.com/weirdNox/org-noter). Here is a little demonstration: You call org-noter in the pdf buffer. Then ...
chriad's user avatar
  • 396
7 votes
Accepted

Search for either of two words using isearch

C-M-s to invoke isearch-forward-regexp then type aaa\|bbb, where aaa is your first word and bbb is your second. Alternatives, just C-s to invoke isearch, then press M-r to toggle to regex.
Xah Lee's user avatar
  • 1,766
6 votes
Accepted

How to print a PDF, displayed with pdf-tools, from Emacs?

You need to set the variable pdf-misc-print-programm and possibly also pdf-misc-print-programm-args in the pdf-misc customisation group. They should be set to the system command that you will print ...
Tyler's user avatar
  • 22.3k
5 votes

Is there continuous scrolling and double page viewing in pdf-tools?

Currently, this is not possible. Several feature requests have been submitted on the project's GitHub page: Feature request: continuous view #27, and more recently, Double pages layout #303. ...
ph0t0nix's user avatar
  • 1,119
5 votes

Call emacsclient from a program called by Emacs

The solution is to run texdoc within an asynchronous process. The best way to do that is probably to use start-file-process instead of shell-command-to-string (which is a handy function for quick&...
Stefan's user avatar
  • 26.5k
5 votes
Accepted

Select a word in a PDF by double-clicking on it (with pdf-tools)

At first, note that pdf-sync binds mouse-double-1 in the minor mode pdf-sync-minor-mode to pdf-sync-backward-search-mouse. So one should probably only bind it in a minor mode that can be deactivated ...
Tobias's user avatar
  • 33.2k
4 votes

How do I rotate pages in pdf-tools?

As @kaushalmodi's post notes, rotation is apparently an open issue for pdf-tools, and it's apparently trickier to implement than expected. Comments on github indicate that a workaround is to use ...
Dan's user avatar
  • 33.1k
4 votes

Use PDFView as default AucTex PDF Viewer

I just set this up yesterday so all you need in your init file is. ;; to use pdfview with auctex (setq TeX-view-program-selection '((output-pdf "PDF Tools")) TeX-view-program-list '(("PDF Tools"...
Jules's user avatar
  • 1,225
4 votes
Accepted

Installing pdf-tools on Windows

You need Emacs and cask installed before compiling pdf-tools. pacman -S python pacman -S git curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python git clone https://github.com/...
Manish Parashar's user avatar
4 votes
Accepted

Is it normal for a package to request [sudo] in order to install a package? (this case pdf-tools) concerned about password integrity

The reason you were asked for your password was that apt-get install was being invoked to install the additional software (poppler and friends) needed by pdf-tools. 1) Is this typical? No -- the ...
phils's user avatar
  • 51.5k
4 votes
Accepted

auctex and pdf-tools in 2 separate frames for dual monitor setup

This is a variation of the question about preview the pdf in a split buffer beside the source. You can use the following Elisp code in your init file. If you do not have already two frames. The pdf ...
Tobias's user avatar
  • 33.2k
3 votes
Accepted

Make pdf-tools remember the page I was on

The pdf-view-restore works for me and is available on MELPA. But the pdf-view-restore github page seems to provide more useful configuration instructions.
dalanicolai's user avatar
  • 7,855
3 votes
Accepted

copy/paste text use pdf-tools in emacs

You should be able to use pdf-view-kill-ring-save to send highlighted text to the kill-ring. At that point you can yank it to a buffer as normal.
mclear's user avatar
  • 1,555
3 votes

pdf-tools indirect buffers

Indirect buffer need special support, since their buffer-file-name is nil. But this is currently not implemented in pdf-tools. So it seems that the answer is no.
politza's user avatar
  • 3,346
3 votes

pdf-tools-install takes a long time on startup

After having pdf-tools installed (just once), put the following in your init file: (add-hook 'doc-view-mode-hook 'pdf-tools-install)
Konrad Podczeck's user avatar
3 votes

How can I change what happens when I click on a pdf-tools link?

I'll answer your actual problem of modifying the action for following links with pdf-tools. The customizable option pdf-links-browse-uri-function holds a function that receives a string with the uri ...
Tobias's user avatar
  • 33.2k
3 votes
Accepted

mu4e: open PDFs with pdf-tools

Recapping discussion in comments: Pressing A e, for "in-emacs", opens the attachment in PDFView. o e works exactly the same.
Heikki's user avatar
  • 3,076
3 votes
Accepted

pdf-tools auctex question with split buffers

The solution at the bottom of this answer does not work anymore after https://github.com/emacs-mirror/emacs/commit/f646675cd1637948b2df2351a9666792ea8251ea The extra argument DEDICATE of window--...
Tobias's user avatar
  • 33.2k
3 votes

Edit PDF page labels in pdf-tools?

You can do this with the Java variant of pdftk, starting from version 3.1.0. First, create a file with the metadata you want, e.g.: PageLabelBegin PageLabelNewIndex: 1 PageLabelStart: 1 ...
Pkkm's user avatar
  • 263
3 votes

error while loading shared libraries: libpoppler.so.101: cannot open shared object file: No such file or directory

TL;DR Go to path/to/.emacs.d/elpa/pdf-tools-xxx/build and run make clean to clean previously compiled contents manually. Restart emacs and let it build pdf-tools. Then, pdf-tools works again :) I ...
Guangyu Zhu's user avatar
3 votes

How can I get horizontal scrolling in PDFview to work?

I had the same problem and I also discovered the hard way that global-display-line-numbers-mode breaks image-forward-hscroll. I have the following workaround: (defun bugfix-display-line-numbers--turn-...
Tobias's user avatar
  • 33.2k
2 votes

How to use the same pdf-tools install on OSX and Linux simultaneously?

I guess one option is to add a .gitignore which prevents Git from tracking that executable. The downside of course is that it will force you to re-build that executable on every machine. Another is ...
Stefan's user avatar
  • 26.5k
2 votes

How do I rotate pages in pdf-tools?

It looks like this feature needs to be added to pdf-tools. Someone has already posted an issue on this github requesting this enhancement: pdf-tools/Issue#89 From one comment, the workaround used ...
Kaushal Modi's user avatar
  • 25.7k
2 votes
Accepted

Error on pdf-tools installation

pdf-tools depends on the tablist package (which you can find on MELPA, for example). I can't help you with the second error.
politza's user avatar
  • 3,346
2 votes

Preview PDFs with helm-bibtex

Look into helm's persistent actions. Basically allows you to execute an action (like opening the PDF) without ending the helm session. If your helm-bibtex is setup to use pdf-tools for viewing PDFs (...
tmalsburg's user avatar
  • 2,570
2 votes
Accepted

Emacs pdf-tools writing function

Got it to work! Thanks guys! I added (add-to-list 'auto-mode-alist '("\\.pdf\\'" . doc-view-mode)) and (add-hook 'doc-view-mode-hook #'pdf-tools-install)
Manan Mehta's user avatar
2 votes

Is there continuous scrolling and double page viewing in pdf-tools?

Maybe a bit late, but there is a fix that works for me, see here: https://github.com/politza/pdf-tools/issues/55 The second-to-last post has a fix which works for me. Place the functions somewhere in ...
mor3dr3ad's user avatar
2 votes
Accepted

pdf-tools-install takes a long time on startup

Try setting the variable pdf-view-use-unicode-ligther to nil, according to the doc it speeds up the loading on systems where looking for the unicode symbols used in the mode line (⎙ and 🌙) takes a ...
matteol's user avatar
  • 2,018

Only top scored, non community-wiki answers of a minimum length are eligible