Function: pdf-util-frame-scale-factor

pdf-util-frame-scale-factor is a natively compiled function defined in pdf-util.el.

Signature

(pdf-util-frame-scale-factor)

Documentation

Return the frame scale factor depending on the image type used for display.

When pdf-view-use-scaling is non-nil, return the scale factor of the frame if available. If the scale factor isn't available, return 2 if the frame's PPI is larger than 180. Otherwise, return 1.

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-util.el
(defun pdf-util-frame-scale-factor ()
  "Return the frame scale factor depending on the image type used for display.
When `pdf-view-use-scaling' is non-nil, return the scale factor of the frame
if available. If the scale factor isn't available, return 2 if the
frame's PPI is larger than 180. Otherwise, return 1."
  (if pdf-view-use-scaling
      (or (and (fboundp 'frame-scale-factor)
               (truncate (frame-scale-factor)))
          (and (fboundp 'frame-monitor-attributes)
               (cdr (assq 'backing-scale-factor (frame-monitor-attributes))))
          (if (>= (pdf-util-frame-ppi) 180)
              2
            1))
    1))