Expand description
Typed PDF annotations (links, sticky notes, highlights, stamps, callouts, attachments, etc.).
stet-pdf-reader already knows about the /Annots array on each
page and renders annotation appearance streams during page
rasterization (content/mod.rs::render_annotation). This module
exposes the same annotations as structured data for callers
that want to inspect, index, or convert them — link extractors,
review aggregators, accessibility tools.
The full PDF annotation set is large (ISO 32000-2 §12.5). This
module parses the common subtypes — Link, Text, FreeText, the four
markup annotations (Highlight / Underline / Squiggly / StrikeOut),
Line, Square, Circle, Polygon, PolyLine, Ink, Stamp, Caret,
FileAttachment, Popup — into typed structs. Less-common subtypes
(Screen, PrinterMark, TrapNet, Watermark, Sound, Movie, Widget,
and any unknown) are exposed via AnnotationKindData::Minimal
with the common fields populated; consumers can still inspect
subtype and kind_data’s Other variant for the raw name.
Widget annotations get a placeholder here; Phase 5 of the reader
plan adds the dedicated FormField type that cross-links them to
the document’s AcroForm.
Structs§
- Annotation
- One PDF annotation.
- Annotation
Flags /Fannotation flags.- Border
/Borderentry:[hradius vradius width [dash]].- Caret
Annotation /Subtype /Caret.- File
Attachment Annotation /Subtype /FileAttachment.- Free
Text Annotation /Subtype /FreeText— visible text on the page.- InkAnnotation
/Subtype /Ink.- Line
Annotation /Subtype /Line.- Link
Annotation /Subtype /Link.- Markup
Annotation - Markup annotations (Highlight / Underline / Squiggly / StrikeOut).
- Polygon
Annotation /Subtype /Polygonor/PolyLine.- Popup
Annotation /Subtype /Popup.- Shape
Annotation /Subtype /Squareor/Circle.- Stamp
Annotation /Subtype /Stamp.- Text
Annotation /Subtype /Text— sticky note.
Enums§
- Annotation
Color /Ccolor array — interpreted by length per spec.- Annotation
Date /Mmodification entry — usually a PDF date string, occasionally an arbitrary string.- Annotation
Kind - Annotation subtype.
- Annotation
Kind Data - Subtype-specific annotation data.
Functions§
- parse_
annotation - Parse a single annotation dict into a typed
Annotation. - parse_
page_ annotations - Parse all annotations on a page from its
PageInfo::annotslist.