THotPDF.AddLoadedTextField Method

Adds a text field to a page of the loaded document and registers it in the AcroForm. The field gets an appearance stream showing its value, and the AcroForm gets the Helvetica default font its /DA string names, so every viewer shows the field

Declaration

function AddLoadedTextField(PageIndex: Integer; X1, Y1, X2, Y2: Single; const AFieldName, AValue: AnsiString; AMaxLen: Integer): Integer;

Unit

HPDFDoc

Parameters

NamePurpose
PageIndexZero-based index of the loaded page that receives the widget
X1Left edge of the widget rectangle in PDF user space (points, origin at the bottom-left corner of the page)
Y1Bottom edge of the widget rectangle in PDF user space
X2Right edge of the widget rectangle in PDF user space
Y2Top edge of the widget rectangle in PDF user space
AFieldNameName of the new field; it must not already exist in the loaded form
AValueInitial value; empty for a blank field
AMaxLenMaximum number of characters, or 0 for no limit

Return value

Index of the new field, for use with the other loaded form field methods, or -1 when PageIndex is out of range

Usage notes

Related APIs