Function: pdf-document-common-bounding-box

pdf-document-common-bounding-box is a natively compiled function defined in pdf-view.el.

Signature

(pdf-document-common-bounding-box &optional FILE-OR-BUFFER)

Documentation

Return the common bounding box for all pages in FILE-OR-BUFFER.

Returns a list (LEFT TOP RIGHT BOTTOM).

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-view.el
(defun pdf-document-common-bounding-box (&optional file-or-buffer)
  "Return the common bounding box for all pages in FILE-OR-BUFFER.
Returns a list (LEFT TOP RIGHT BOTTOM)."
  (let ((left 1.0)
        (top 1.0)
        (right 0.0)
        (bottom 0.0))
    (dotimes (i (pdf-info-number-of-pages file-or-buffer))
      (cl-destructuring-bind (b-left b-top b-right b-bottom) (pdf-info-boundingbox (1+ i) file-or-buffer)
        (setq left (min left b-left)
              top (min top b-top)
              right (max right b-right)
              bottom (max bottom b-bottom))))
    (list left top right bottom)))