THotPDF.AddLoadedCheckBox Method
Adds a check box to a page of the loaded document and registers it in the AcroForm. The field gets on and off appearance states, and its appearance state follows AChecked
Declaration
function AddLoadedCheckBox(PageIndex: Integer; X1, Y1, X2, Y2: Single; const AFieldName, AExportValue: AnsiString; AChecked: boolean): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the loaded page that receives the widget |
X1 | Left edge of the widget rectangle in PDF user space (points, origin at the bottom-left corner of the page) |
Y1 | Bottom edge of the widget rectangle in PDF user space |
X2 | Right edge of the widget rectangle in PDF user space |
Y2 | Top edge of the widget rectangle in PDF user space |
AFieldName | Name of the new field; it must not already exist in the loaded form |
AExportValue | Name of the on state and the value exported when checked; Yes when empty |
AChecked | True to create the box checked |
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
- Use this API in the page geometry 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
- Loaded-document object references may be indirect; resolve arrays, dictionaries, or streams before inspecting nested values