THotPDF.SetLoadedFormFieldValueByIndex Method
Sets the current value of an AcroForm form field in the loaded PDF document by field index
Declaration
procedure SetLoadedFormFieldValueByIndex(FieldIndex: Integer; const AValue: AnsiString);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldIndex | Zero-based index of the target field in the AcroForm field array |
AValue | The new value string to write to the V entry of the form field |
Usage notes
- 对复选框字段,AValue 应为导出值(Export Value)或
Off,而非true/false - After setting the value, the appearance stream (Appearance Stream) of the field may need to be synchronised, otherwise some readers will still display the old value before saving
- Changes must be saved before they can be written to the output file