Search code examples
pdfemacsorg-mode

Cannot select text/make markup annotations pdf-tools in emacs


I've installed pdf-tools for emacs (Mac OS X 10.12.6, Emacs 24.5.1), but for some reason, Add Markup Annotation is greyed out (See screenshot) and I cannot select text, which gives this error on each mouse press when I try text selection in a pdf opened in pdfview:

x-create-frame-with-faces: Wrong type argument: integerp, (0.5)

Any ideas? anyone seen that before? I've tried debug-on-error but it doesn't lead to any messages so I'm kinda stuck. Upgrading to Emacs 25.3 didn't change anything and the usual restart the computer/fresh re-install pdf-tools did not solve the issue.

Screenshot of grayed out pdf-tools menu

FWIW: the relevant section from my .emacs:

(use-package pdf-tools
   :ensure t
   :config
   (custom-set-variables
   '(pdf-tools-handle-upgrades nil))
   (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo")
   (pdf-tools-install)
)

(setenv "PKG_CONFIG_PATH" "/usr/local/Cellar/zlib/1.2.11/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig")

(use-package org-pdfview
  :ensure t)

(require 'pdf-tools)
(require 'org-pdfview)

Solution

  • It took a while to narrow down in my .emacs but turns out it has nothing to do with pdf-tools itself but was a conflict from settings I use to auto adjust the emacs window size on start up.

    (add-to-list 'default-frame-alist '(height . 50)) (add-to-list 'default-frame-alist '(width . 170))

    Commenting them out brought back the option to add markup annotations and to select/copy and highlight annotations.