Automatic XFA choice and boolean creation
Unit: HPDFXFAHeadless
HPDFXFAWriteHeadlessPDF consumes the actual XFA layout and constructs choice fields, checkbox widgets and radio parents and members without prepared PDF slots
Choice fields
Combo and list fields use native /FT /Ch dictionaries; separate XFA display and save lists become /Opt export/display pairs, preserving Unicode, delimiters, explicit empty exports, typed scalar items and surrounding export whitespace
An editable combo retains its free text value; a noneditable choice requires the selected export to exist in its option list
Multi-select values become an ordered native /V array and matching /I indices in option order; ordinary value-only input uses newline-separated exports and rejects duplicate selected values during preparation
Choice item scripting preserves exact explicit indices for duplicate and empty exports through saved XDP, so their PDF /I arrays, exported /V values and display-label appearances remain unambiguous
Duplicate selection validation compares exact strings without reordering the authored selection list; an index heap sort replaces quadratic pair comparisons and checks cancellation throughout uniqueness validation
Choice appearance text uses display labels, while /V uses export values; list appearances contain a measured visible window with the first selection, an exact /TI top index and relative selected-row highlights while retaining the complete option graph
The native combo, edit, multi-select, selection-commit and readOnly flags use exact PDF integer tokens so a high flag bit cannot erase the readOnly bit
Checkbox and radio states
Checkboxes contain real Off and on-state Form XObjects; Boolean styles and captions consumes actual marker shapes, size, UI outlines, field colors, scalar Unicode captions and third checkbox states without relying on a checkmark character in the supplied font
The native /Opt retains the XFA export value; the reserved Off export and exports beginning with XFAOn receive collision-free active-state aliases, while their actual export strings remain unchanged in /Opt
Radio members share one native parent per template exclusion-group path and native data-context path; repeated groups receive independent /Kids, /V, /Opt and widget /AS states even when their displayed group names are identical
Equal exports within one radio group set RadiosInUnison and activate every corresponding member; document-wide editing policy and exclusion-group access determine the parent's readOnly flag
Exclusion-group tb and lr-tb layout is dispatched with the current native data scope, and positioned exclusion groups apply their own x/y origin to their members
Runtime persistence and preparation
Exclusion-group rawValue reads and assignments participate in the existing native event transaction, binding cells, form/data synchronization and rollback; saved runtime XDP can be passed directly to the automatic creator
The acceptance fixture mutates the second repeated combo, checkbox and exclusion group, reads the group through its data alias immediately, saves XDP and independently verifies the resulting PDF values, states and appearances while preserving the first instance
All candidate preparation failures preserve destination bytes, length and position; choice option arrays, field names, boolean exports, widget counts, graph allocations and aggregate appearance text retain the existing resource limits
Destination I/O failure retains the caller-stream boundary described by Automatic XFA creation
Remaining consumer work
Rich captions, wrapped caption sizing, per-edge and filled outline styles, later widget state commits, later interactive list scrolling, value-only ambiguity for exports containing line breaks, advanced exclusion-group layouts and signature fields remain separate integration work
Choice metadata documents the additive callback hints used by these native consumers