THotPDF.SetFormFieldValue Method

Sets the value of a field in a loaded AcroForm. Text and choice fields also get a new appearance stream showing the value, so every viewer and printer shows the new text; check boxes and radio buttons switch their appearance state to the new value. Save the document with SaveLoadedDocument or an incremental update afterwards

For loaded multiline text fields, the generated appearance preserves explicit empty paragraphs and their line spacing while wrapping nonempty paragraphs at whole-word boundaries. CR, LF, and CRLF separators are supported. A single terminal separator ends the preceding paragraph; two terminal separators retain one trailing empty paragraph. An empty whole value produces an empty appearance

Declaration

procedure SetFormFieldValue(FieldIndex: Integer; const Value: AnsiString); overload;
procedure SetFormFieldValue(const FieldName, Value: AnsiString); overload;

Unit

HPDFDoc

Parameters

NamePurpose
FieldIndexIndex of the field, from 0 to GetFormFieldCount - 1
FieldNameFully qualified field name, as returned by GetFormFieldName
ValueNew value; for check boxes and radio buttons the export value of the state to select, or Off

Return value

This member does not return a value

Usage notes

Related APIs