THotPDF.ImportLoadedInterchangeFromFDF Method

function ImportLoadedInterchangeFromFDF(Source: TStream;
  ApplyFields, ApplyAnnotations: Boolean; out Status: AnsiString;
  out AInfo: THPDFFDFInterchangeInfo): Boolean;

Reads an FDF 1.2 stream and independently applies field values and annotations to the loaded document

Status is returned even when the caller disables field or annotation application

Modern Windows builds import annotation dictionaries and supplied appearance resources through the bounded FDF object-graph codec, retaining shared indirect objects and remapping actual local GoTo page targets

Choice arrays are validated before replacing the target value and selection indices; empty arrays clear the selection, while scalar fields retain the stream API's existing update behavior

Field dictionaries may also carry /Ff, /SetFf and /ClrFf flag updates: an explicit /Ff replaces the 32-bit mask while /SetFf and /ClrFf combine against the current inherited flags, read-only fields reject changes, single-select choices require scalar values, pushbuttons cannot retain values and appearance-affecting bits rebuild the widget appearance stream

Unknown fields and rejected field updates can raise exceptions; the entire import runs in a nested object graph transaction, so a failed import restores all earlier field values, annotation changes, and newly allocated appearance resources

A failed import clears Status and AInfo; a successful import commits only its own transaction, so a caller can still roll it back through an enclosing transaction

Arrays require a multi-select choice field and direct string elements; unresolved FDF references are not interpreted as target PDF object numbers

In modern Windows builds, a transaction with actual field or annotation changes also validates authenticated encryption permissions, signed-revision policies and the complete current dirty graph before commit

A policy failure follows the same nested transaction rollback and clears Status and AInfo; this does not introduce a new field-only FDF permission model

Nonterminal parent field flags

Modern Windows THotPDF interchange accepts flag-only /Ff, /SetFf and /ClrFf requests for an actual nonterminal AcroForm parent, resolved through its qualified name and real field-tree relationships

A non-null /Ff takes precedence and replaces the exact 32-bit mask; otherwise SetFf is applied before ClrFf, with null operands treated as absent and signed 32-bit or unsigned 32-bit integer spellings preserving their bit patterns

Absent or null child Ff entries continue to inherit the nearest non-null mask, while an explicit local zero remains an override; a parent no-op creates no child override, and one changed parent counts once in AInfo.FieldCount regardless of descendant fanout

Appearance-affecting parent changes refresh only children whose effective flags change, preserving their local Ff, V, RV and I state; explicit null values retain their empty appearance behavior, and unchanged nonvisual flags preserve existing appearance resources

Original read-only value authority is captured before the package is applied, so an earlier parent or child flag clear cannot authorize a changed value on a field that was originally read-only; a same-value request can accompany an otherwise permitted flag update

Authenticated admission checks actual inherited flag changes against FieldMDP child locks and protects descendants of a locked parent; an unchanged child with a local override does not block an otherwise permitted update to its unlocked parent and sibling

Nonterminal requests in this extension are flag-only: applying a parent V or propagating parent values is outside this scope; the legacy file importer and public terminal-field enumeration retain their existing contracts

Annotation identity and graph transport

A matching nonempty annotation NM on the same page selects an existing annotation for replacement; unnamed or unmatched annotations are appended, and ambiguous matches fail before commit

Fields, annotations and status remain independently selected by the existing parameters; annotation resources join the same nested object-graph transaction, so a failed mixed import restores earlier field and annotation changes together

Action dictionaries are transported as data without executing scripts, following external file references or applying redactions

See FDF annotation behavior and boundaries and loaded annotation policy