THotPDF.SetLoadedFormFieldDefaultValue Method
Sets the default value of the loaded PDF form field, which determines the initial content the field should restore to after a reset operation is performed
Declaration
procedure SetLoadedFormFieldDefaultValue(FieldIndex: Integer; const AValue: AnsiString);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldIndex | The zero-based index of the target form field |
AValue | The new default value string that will replace the field's original default value |
Usage notes
- 设置默认值不会立即改变字段的当前显示值,需另外调用赋值方法才能同步更新当前内容
- 对于复选框字段,
AValue应为有效的选项导出值或Off,否则重置行为可能不符合预期 - 修改后需保存文档才能生效;与
ResetLoadedFormField配合可实现表单重置预设功能