THPDFFDFAnnotationGraph class
Unit: HPDFFDFAnnotations
Owns a bounded FDF value graph, its indirect objects and its annotation array
Reading and writing
Decode(Bytes, Options, AllowFields) validates complete binary FDF data and returns a graph owned by the caller; Encode returns canonical FDF bytes with regenerated stream lengths and cross-reference offsets
AnnotationCount, Annotation, AnnotationPage and ObjectCount inspect the admitted annotation graph; Resolve follows graph-scoped indirect references
The optional AllowFields decoding flag admits a Fields array for graph inspection; it does not implement field filling or authorize an annotation-only adapter to discard field updates
Building
Create the graph with THPDFFDFOptions, call StartAnnotations, then use CreateValue, SetScalar, SetStream, AddItem, AddEntry, Define and AppendAnnotation to construct its values
Builder scalar tokens use PDF syntax, such as a slash-prefixed name or a parenthesized string; dictionary entry names are decoded name bytes without a leading slash
Every value belongs to its graph and container entries are borrowed; do not free a child independently, attach a value from another graph or retain a value after freeing its graph
Constructed streams receive their canonical Length during encoding; provide stream bytes rather than constructing a matching Length entry manually
Context and limits
ActionCount, Action, IsLocalGoTo, IsLocalDestination and LocalDestinationPage inspect actual annotation action contexts without executing their actions
Graph mutation invalidates cached action contexts; subsequent queries rebuild them under the same working-storage, depth and cancellation limits
ReservedBytes reports conservative admission accounting, while Reserve allows an adapter to admit additional graph-related storage before allocation
Malformed references, duplicate decoded dictionary names, invalid annotation pages, inadmissible subtypes and exceeded limits raise an exception before an encoded result is returned
See native annotation FDF exchange for document-level replacement, permission and publication behavior