Native annotation FDF exchange
Binary FDF annotation exchange preserves PDF object graphs rather than mapping each annotation to a fixed XML vocabulary
Use ExportAnnotationsFDF to produce FDF bytes and SaveAnnotationsFDFToFile to prepare an independent incremental PDF revision
Graphs and appearance resources
The graph retains names, exact numeric tokens, literal and hexadecimal string bytes, arrays, dictionaries, indirect references and stream bytes
Annotation appearance states, AS selections, shared fonts and images, and Redact RO streams retain their shared-reference topology; output object numbers and serialization can change
Stream lengths are regenerated from the retained bytes when encoding; indirect source lengths are resolved during decoding and checked before publication
Explicit local GoTo destination arrays in A, admitted AA events and Next chains are remapped in their actual action context to the destination document's page objects; a dictionary elsewhere in a resource graph is not treated as an action merely because its keys resemble one
Interchange preserves action data without executing scripts, following external file references, navigating destinations or applying redactions
Import behavior
FDF Page values are zero-based page indices and must identify pages in the loaded document
A matching nonempty NM on the same page identifies an existing annotation for replacement; an unnamed or unmatched annotation is appended, and ambiguous names fail before publication
Semantically unchanged annotation imports return zero; exact no-op publication and callback recovery are part of the acceptance contract
The native save method leaves the loaded document unchanged after success as well as failure; load the saved PDF to adopt its new revision
Permissions and limits
Export requires extraction permission, while actual annotation changes require annotation permission and authenticated signature-policy admission
Certification P1 and P2 prevent annotation changes; permitted P3 revisions preserve the original signed bytes, with encrypted input permissions and field-lock policies evaluated against the actual document
THPDFFDFOptions bounds bytes, nodes, objects, depth, annotation count and working storage independently, with cooperative cancellation throughout parsing, preparation and output
A failed or cancelled save preserves the destination file and the loaded graph; callback clients also retain their last committed document when output or result publication fails
Boundaries
Link, Movie, Widget, PrinterMark, Screen and TrapNet are excluded from the standard FDF Annots profile
Annotation-only imports reject nonempty Fields and embedded document Differences instead of silently discarding their effects
Arbitrary XFDF appearance-container syntax, annotation deletion, embedded FDF file processing and applying embedded document revisions remain separate work
Appearance transport preserves supplied AP resources; it does not synthesize a missing appearance or execute an annotation's action
See mapped XFDF exchange for the XML profile and THPDFFDFAnnotationGraph for the standalone graph API
Explicit annotation removal
Page-and-name annotation removal is a separate operation; omitting an annotation from imported FDF or XFDF does not delete it
Widget field-tree deletion and secure erasure require separate operations; incremental removal retains previous PDF bytes