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 genuine name-valued V and widget AS states together with explicit Off and on-state Form XObjects

OnState is a raw bounded export-state name other than Off; Checked false writes Off, whilst 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 normalise escaped keys once before entering the semantic-key object graph; existing normalised keys and the caller's raw OnState are not decoded again, so a space and a literal #20 remain distinct state names

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

Radio widgets keep their existing individual on-state names; only widgets matching OnState get selected, and ambiguous or unknown states leave the previous graph in place

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