THPDFHeadlessDocument.SetButtonFieldValueWithAppearance

procedure SetButtonFieldValueWithAppearance(FieldIndex: Integer;
  const OnState: AnsiString; Checked: Boolean; const TrueTypeFont: SysUtils.TBytes;
  const Options: THPDFHeadlessTextAppearanceOptions);

Updates a writable checkbox or radio Btn field with real name-valued V and widget AS states, plus explicit Off and on-state Form XObjects

OnState is a raw bounded export-state name other than Off; Checked false writes Off, while Checked true writes the selected export name

Generated checkbox and radio appearance-state dictionaries preserve export names containing spaces or literal #20 sequences, keeping the name-valued V and AS entries matched to the corresponding AP/N state key through saving and reloading

Freshly parsed appearance dictionaries normalize escaped keys once before entering the semantic-key object graph; existing normalized keys and the caller's raw OnState are not decoded again, so a space and a literal #20 remain distinct state names

Checkboxes paint rectangular borders and a Unicode check glyph; radios paint circular borders and a selected dot using the supplied embeddable TrueType font

Radio widgets retain their existing individual on-state names; only widgets matching OnState are selected, and ambiguous or unknown states preserve the previous graph

Push buttons use SetPushButtonAppearance; read-only fields, denied form filling, signed-document editing policies, cancellation, and aggregate object budgets remain enforced