THPDFHeadlessDocument.SetChoiceFieldValueWithAppearance

procedure SetChoiceFieldValueWithAppearance(FieldIndex: Integer;
  const SelectedValue: UnicodeString; const TrueTypeFont: SysUtils.TBytes;
  const Options: THPDFHeadlessTextAppearanceOptions);

Updates a writable Ch field and generates normal appearances for all its widgets

SelectedValue is the export value from Opt; export/display pairs retain their original labels while V stores the export string and I stores its selected index

Combo boxes display the selected label, or a caller value when the combo edit flag permits it; list boxes display labels from TI without soft wrapping and paint the selected row blue

Unknown noneditable export values, read-only fields, malformed options, exhausted budgets, and cancellation preserve the prior value and appearance links

Multiple-selection list boxes retain an array-valued V when this helper selects one value; an empty SelectedValue clears the selection

Use SetChoiceFieldValuesWithAppearance for multiple values or an explicit empty export string

Changes to signed or certified documents require a separate signature-aware form policy