Closed jeffalstott-iarpa closed 3 years ago
I cannot reproduce this, but I presume it has something to do with HiDPI support (since I don't have a hidpi display). Try disabling pdf-view-use-scaling
(after! pdf-view
(setq pdf-view-use-scaling nil))
Or undo our retina hacks:
(after! pdf-view
(advice-remove #'pdf-util-frame-scale-factor #'+pdf--util-frame-scale-factor-a)
(advice-remove #'pdf-view-use-scaling-p #'+pdf--view-use-scaling-p-a)
(dolist (fn '(pdf-annot-show-annotation
pdf-isearch-hl-matches
pdf-view-display-region))
(advice-remove fn #'+pdf--supply-width-to-create-image-calls-a)))
The first suggestion didn't work but the second did! Unfortunately, it does leave the PDF looking quite blurry. What would you suggest for next steps to retain the bulk of the high-resolution functionality while still getting search?
It's tricky, I'm afraid. I don't have a mac, much less a retina display to test this on, so I'll need your help to find the solution. Please remove the snippet I suggested earlier and try this instead:
(after! pdf-view
(defvar +pdf--is-scaled-p nil)
(defadvice! add-retina-support-a (orig-fn &rest args)
:around #'pdf-util-frame-scale-factor
(if (and pdf-view-use-scaling
(memq (pdf-view-image-type) '(imagemagick image-io))
(fboundp 'frame-monitor-attributes))
(funcall orig-fn)
;; Add special support for retina displays on MacOS
(if (and (eq (framep-on-display) 'ns)
(not +pdf--is-scaled-p)
EMACS27+)
(progn
(setq-local +pdf--is-scaled-p t)
2)
1)))
(advice-remove #'pdf-util-frame-scale-factor #'+pdf--util-frame-scale-factor-a))
Side note: could you do M-: (pdf-util-frame-ppi)
in that pdf buffer and tell me it return value?
With your latest modification:
And search still works.
Without the modification: And search has the zooming problem.
So, it looks like that fixed it!
could you do M-: (pdf-util-frame-ppi) in that pdf buffer and tell me it return value? Having difficulty with that: I'm new to emacs, but hitting alt+: (which, for completeness, is alt+shift+the ;/: key) gives the above response. So I don't get to the point of being able to type
pdf-util-frame-ppi
I'm new to emacs, but hitting alt+: (which, for completeness, is alt+shift+the ;/: key) gives the above response. So I don't get to the point of being able to type pdf-util-frame-ppi
Then could you try M-x eval-expression RET (pdf-util-frame-ppi)
(must be run from the pdf file).
That worked! 128.1596... Was that what you were expecting?
As of 8914b7b this issue should be resolved. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!
That worked! 128.1596... Was that what you were expecting?
Yup, thanks!
What did you expect to happen? Able to open a PDF and search within it.
What actually happened? Search "works", but each keystroke causes the PDF to zoom in, rendering it useless.
Additional details: Described on
pdf-tools
main repo here: https://github.com/politza/pdf-tools/issues/634Just about to search typed "b" Oh, it started zooming. I...guess that makes sense? Let's type "a" Uh, that's a bit much zoom. Let's type "c" Uuuuh. "k"
Steps to reproduce:
pdf
ininit.el
/
and start searchingSystem information: