Function: pdf-info-renderpage-highlight

pdf-info-renderpage-highlight is a natively compiled function defined in pdf-info.el.

Signature

(pdf-info-renderpage-highlight PAGE WIDTH &optional FILE-OR-BUFFER &rest REGIONS)

Documentation

Highlight regions on PAGE with width WIDTH using REGIONS.

REGIONS is a list determining the background color, a alpha value and the regions to render. So each element should look like (FILL-COLOR STROKE-COLOR ALPHA (LEFT TOP RIGHT BOT) (LEFT TOP RIGHT BOT) ... )
.

For the other args see pdf-info-renderpage.

Return the data of the corresponding PNG image.

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-info.el
(defun pdf-info-renderpage-highlight (page width
                                           &optional file-or-buffer
                                           &rest regions)
  "Highlight regions on PAGE with width WIDTH using REGIONS.

REGIONS is a list determining the background color, a alpha value
and the regions to render. So each element should look like \(FILL-COLOR
STROKE-COLOR ALPHA \(LEFT TOP RIGHT BOT\) \(LEFT TOP RIGHT BOT\) ... \)
.

For the other args see `pdf-info-renderpage'.

Return the data of the corresponding PNG image."

  (when (consp file-or-buffer)
    (push file-or-buffer regions)
    (setq file-or-buffer nil))

  (apply #'pdf-info-renderpage
    page width file-or-buffer
    (apply #'append
      (mapcar (lambda (elt)
                `(:background ,(pop elt)
                  :foreground ,(pop elt)
                  :alpha ,(pop elt)
                  ,@(cl-mapcan (lambda (edges)
                                 `(:highlight-region ,edges))
                               elt)))
              regions))))