Returns one tibble row per annotation on the given page,
carrying the structural metadata PDFium surfaces: subtype,
bounding box, raw + decoded flags, the three free-text string
entries (/Contents, /T, /Subj), color (/C) and interior
color (/IC), and the annotation's stroke border width. For
form-widget-specific fields (field type, field value, choice
options) use pdf_form_fields() instead.
Arguments
- page
A
pdfium_pagefrompdf_page_load(), or apdfium_doc(in which casepage_numselects the page).- page_num
One-based page index. Only used when
pageis apdfium_doc. Ignored otherwise.
Value
A tibble with columns:
annotation_indexinteger - 1-based index within the page's annotation table.subtype_codeinteger - the rawFPDF_ANNOT_*enum value (0..28). Useful when round-tripping into v0.2.0 writers that take the enum directly.subtypecharacter - one of"text","link","freetext","line","square","circle","polygon","polyline","highlight","underline","squiggly","strikeout","stamp","caret","ink","popup","fileattachment","sound","movie","widget","screen","printermark","trapnet","watermark","threed","richmedia","xfawidget","redact", or"unknown"."widget"annotations are AcroForm fields; pass the document topdf_form_fields()for their field-level metadata.flagsinteger - the raw 32-bit/Fflag bitmask.is_invisible,is_hidden,is_print,is_no_view,is_read_only,is_lockedlogical - decoded flag bits (bits 1, 2, 3, 6, 7, 8 from PDF spec Table 165).bounds_left,bounds_bottom,bounds_right,bounds_top- rectangle in PDF user space.contentscharacter - the annotation's/Contentsbody text, UTF-8 encoded. Empty when absent.titlecharacter - the annotation's/T(title / author) text. Empty when absent.subjectcharacter - the annotation's/Subjsubject line. Empty when absent.color_red,color_green,color_blue,color_alphanumeric - the annotation's/Ccolor components in 0..1.NAwhen the annotation has no/C.interior_red,interior_green,interior_blue,interior_alphanumeric - the annotation's/ICinterior color components in 0..1 (used by line/square/ circle / polygon subtypes).NAotherwise.border_widthnumeric - the stroke border width PDFium reports for/Border//BS.NAfor subtypes that don't carry a border.quad_pointslist-column - for highlights, underlines, strikeouts, squigglies (and any other quad-bearing subtype), a numeric matrix with one row per quad set and eight columnsx1, y1, x2, y2, x3, y3, x4, y4in PDF user space.NULLfor annotations without/QuadPoints. Multi-line highlights produce one row per line.verticeslist-column - for line / polygon / polyline annotations, an N-by-2 numeric matrix with columnsx, y.NULLfor other subtypes.ink_pathslist-column - for ink annotations, a list of stroke paths, each an N-by-2 numeric matrixx, y.NULLfor non-ink annotations. One element per ink stroke; a single-stroke ink annotation produces a length-1 list.font_color_red,font_color_green,font_color_bluenumeric - the annotation's text-fill color (/DA"g"/"rg"/ "k" operands) in 0..1. Meaningful for FreeText / Widget subtypes that carry inline text;NAfor others.font_sizenumeric - the text-fill font size from/DA;NAwhen the annotation doesn't carry variable text.popup_indexinteger - 1-basedannotation_indexof the linked/Popupannotation on the same page (for sticky-note + popup pairs);NAwhen none.irt_indexinteger - 1-basedannotation_indexof the/IRT(in-reply-to) annotation for comment threads;NAwhen none.file_attachment_namecharacter - the attachment name forfileattachment-subtype annotations;NAfor other subtypes.
Returns a 0-row tibble of the same schema when the page has no annotations.
Details
Wraps FPDFPage_GetAnnotCount, FPDFPage_GetAnnot,
FPDFAnnot_GetSubtype, FPDFAnnot_GetFlags,
FPDFAnnot_GetRect, FPDFAnnot_GetStringValue,
FPDFAnnot_GetColor, FPDFAnnot_GetBorder,
FPDFAnnot_GetAttachmentPoints / _HasAttachmentPoints /
_CountAttachmentPoints, FPDFAnnot_GetVertices, and
FPDFAnnot_GetInkListCount / _GetInkListPath.
See also
pdf_form_fields() for AcroForm-specific accessors.