THPDFPage.CreateTextField Method
Method summary: THPDFPage.CreateTextField Method
Declaration
function CreateTextField(const FieldName, InitialValue: AnsiString; Rectangle: TRect; MaxLen: Integer = 0; Flags: THPDFFormFieldFlags = []): THPDFAcroFormField;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldName | Name of the form field |
InitialValue | Initial text value |
Rectangle | Widget rectangle on the page |
MaxLen | Maximum accepted text length, or 0 for no explicit limit |
Flags | Additional form field flags |
Return value
THPDFAcroFormField wrapper for the created text field
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 behaviour
Usage notes
- Use the returned wrapper when the text field needs additional appearance or action configuration
- Use THPDFPage.AddTextField for the simpler one-call workflow
- Page-level changes affect subsequent operators on the same page; save and restore graphics state when a temporary setting should not leak