Function: pdf-info-getannots

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

Signature

(pdf-info-getannots &optional PAGES FILE-OR-BUFFER)

Documentation

Return the annotations on PAGE.

See pdf-info-normalize-page-range for valid PAGES formats.

This function returns the annotations for PAGES as a list of alists. Each element of this list describes one annotation and contains the following keys.

page - Its page number.
edges - Its area.
type - A symbol describing the annotation's type.
id - A document-wide unique symbol referencing this annotation.
flags - Its flags, binary encoded.
color - Its color in standard Emacs notation.
contents - The text of this annotation. modified - The last modification date of this annotation.

Additionally, if the annotation is a markup annotation, the following keys are present.

label - The annotation's label.
subject - The subject addressed.
opacity - The level of relative opacity.
popup-edges - The edges of a associated popup window or nil.
popup-is-open - Whether this window should be displayed open.
created - The date this markup annotation was created.

If the annotation is also a markup text annotation, the alist contains the following keys.

text-icon - A string describing the purpose of this annotation.
text-state - A string, e.g. accepted or rejected.

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-getannots (&optional pages file-or-buffer)
  "Return the annotations on PAGE.

See `pdf-info-normalize-page-range' for valid PAGES formats.

This function returns the annotations for PAGES as a list of
alists.  Each element of this list describes one annotation and
contains the following keys.

page     - Its page number.
edges    - Its area.
type     - A symbol describing the annotation's type.
id       - A document-wide unique symbol referencing this annotation.
flags    - Its flags, binary encoded.
color    - Its color in standard Emacs notation.
contents - The text of this annotation.
modified - The last modification date of this annotation.

Additionally, if the annotation is a markup annotation, the
following keys are present.

label        - The annotation's label.
subject      - The subject addressed.
opacity      - The level of relative opacity.
popup-edges  - The edges of a associated popup window or nil.
popup-is-open - Whether this window should be displayed open.
created      - The date this markup annotation was created.

If the annotation is also a markup text annotation, the alist
contains the following keys.

text-icon  - A string describing the purpose of this annotation.
text-state - A string, e.g. accepted or rejected." ;FIXME: Use symbols ?

  (let ((pages (pdf-info-normalize-page-range pages)))
    (pdf-info-query
     'getannots
     (pdf-info--normalize-file-or-buffer file-or-buffer)
     (car pages)
     (cdr pages))))