THotPDF.AddLoadedTextField Method
Adds a new text input field to the specified page of the loaded PDF and returns the field's index in the global field list
Declaration
function AddLoadedTextField(PageIndex: Integer; ARect: THPDFRect; const AFieldName: AnsiString): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the page where the field is to be added |
ARect | The rectangular area of the field on the page (PDF user coordinates) |
AFieldName | The unique name of the field, used to identify the field during form submission or FDF export |
Return value
Returns the zero-based integer index of the newly created text field in the global field list, which can be used for subsequent field property settings
Usage notes
- 字段名称在文档内应保持唯一,重名字段在表单提交时会共享同一值并相互覆盖
- Newly added fields have no style settings by default; if appearances such as borders or background colours are required, they should be configured via field property methods after adding
- The document must be saved after adding the field to make changes persistent; the returned index is valid only for the current session, and the index may change after reloading the document