THPDFPage.CreateTextField Method
Provides the CreateTextField behavior for the AcroForm workflow. Use it when the surrounding API family needs explicit control over PDF objects, page content, resources, conformance, or diagnostics
Declaration
function CreateTextField(const FieldName, InitialValue: AnsiString; Rectangle: TRect; MaxLen: Integer= 0; Flags: THPDFFormFieldFlags= []): THPDFAcroFormField;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldName | AcroForm field name or field dictionary targeted by the helper |
InitialValue | Input used by CreateTextField |
Rectangle | Page area or widget rectangle where the operation is applied |
MaxLen | Input used by CreateTextField |
Flags | Input used by CreateTextField |
Return value
Returns a THPDFAcroFormField value
The field mask assembled from Flags retains its exact integer bits during creation and subsequent fluent flag edits, saving and reloading
See AcroForm field flag precision for signed mask values, inheritance and native builder behavior
Usage notes
- Use this API in the AcroForm workflow before the affected page, resource, field, or catalog object is finalized
- Keep object names, field names, resource names, and returned handles stable until the document is finalized
- Page-level changes affect subsequent operators on the same page; save and restore graphics state when a temporary setting should not leak