SetSelectedIndices(IEnumerable) Method

Definition

Namespace Broadside.Forms
Assembly Broadside.dll

Selects the options at indices in Options (none when empty) and regenerates the widgets' appearances.

public void SetSelectedIndices(IEnumerable<int> indices)

Parameters

indices
IEnumerable<Int32>

Indices into Options, in any order; more than one only when IsMultiSelect.

Remarks

ISO 32000-2 §12.7.5.4 and Table 234. The value (V) is stored in the field's own dictionary as the selected option's export value, an array of them when several are selected, and removed when none is. The indices (I, PDF 1.4) are stored, ascending, when the field is multi-select or a selected option shares its export value with another ("shall be used"), and removed otherwise. A list box whose first selected option is not visible scrolls to it (TI).

Appearances are generated as GenerateAppearances() describes, before anything changes, so a failure leaves the document as it was. When the form also has an XFA resource (Annex K), only the AcroForm value changes and an XfaDataNotUpdated information diagnostic is recorded.