Automatic XFA list scrolling

Unit: HPDFXFAHeadless

HPDFXFAWriteHeadlessPDF generates an initial native list appearance that contains the first selected option, including a selection near the end of a long option list

Visible option window

The creator measures the supplied TrueType font's ascent and descent at the effective field font size and uses the native appearance builder's padding and line spacing to determine the available rows

The first selected option starts the window; preceding whole options fill unused space near the end when they fit, and the exact native integer /TI records the first visible option index

An unselected list starts at option zero; an empty list retains an empty option array and appearance

Only visible display-label lines enter the appearance text and its glyph map, and selected visible lines receive highlight rectangles relative to the window

Multiple selections retain every selected export and option index even when distant selections cannot all fit in the same window

Multiline labels and persistence

CR, LF and CRLF label breaks use the same line semantics as the native appearance builder; a label that exceeds the available height contributes only its visible prefix to the appearance

The complete /Opt export/display pairs, /V values and /I selection indices remain in the PDF field graph, including labels and values outside the appearance window

Saved runtime XDP is consumed directly, so a changed selection or font size on a repeated instance produces that instance's own window while preserving other instances

Budgets and cancellation

Visible appearance text contributes to aggregate glyph use; the existing choice option-count and object-byte limits continue to bound the complete option graph

Option traversal, multiline scanning, window construction and selected-line processing include cancellation checks

A preparation failure preserves caller bytes, length and position; destination I/O failure follows the boundary documented by Automatic XFA creation

Scope

This behavior applies to the initial saved list appearance and top index; later interactive scroll changes and dynamic choice-item editing require their own native editing integration

Combo appearances retain their scalar display behavior, and choice creation documents values, option pairs and field flags