Function: doc-view-guess-paper-size
doc-view-guess-paper-size is a byte-compiled function defined in
doc-view.el.gz.
Signature
(doc-view-guess-paper-size IW IH)
Documentation
Guess the paper size according to the aspect ratio.
Source Code
;; Defined in /usr/src/emacs/lisp/doc-view.el.gz
(defun doc-view-guess-paper-size (iw ih)
"Guess the paper size according to the aspect ratio."
(cl-labels ((div (x y)
(round (/ (* 100.0 x) y))))
(let ((ar (div iw ih))
(al (mapcar (lambda (l)
(list (div (nth 1 l) (nth 2 l)) (car l)))
doc-view-paper-sizes)))
(cadr (assoc ar al)))))