property FormFieldInfo[Index: Integer]: TPdfFormFieldInfo; // read only
FormFieldInfo returns a snapshot TPdfFormFieldInfo record for the form
field widget annotation at the zero-based Index on the currently active
page. The record provides a strongly typed view of one AcroForm field widget without
having to crack the underlying FPDF_ANNOTATION handle. PDF 1.7 spec
section 12.7 defines the underlying field types and flags.
The record carries the field Name (fully qualified path through any
parent field group, e.g. "order.shipto.address"), the
AlternateName used for accessible tooltips, the
FieldType enumeration (fiPushButton, fiCheckBox,
fiRadioButton, fiTextField, fiListBox,
fiComboBox, fiSignature, or fiUnknown), the
bit-set Flags (ffReadOnly, ffRequired,
ffNoExport, …), the ExportValue as written to a
FormData export, the Checked flag for boolean fields, the
FontSize used for rendering, and the option-set arrays
OptionLabels / OptionSelected used by combo and list boxes.
Radio button widgets that belong to a group additionally fill GroupCount
and GroupIndex.
Valid indices are 0 .. FormFieldCount - 1. The record is a value type;
modifying its fields does not write back to the document. To change the value of a
field, assign through FormField[Index]; to alter the flag bitmask call
SetFormFieldFlagsAt. Reading is lazy — PDFium decodes Unicode field
names, option labels and export values on demand — so cache the result when you
iterate many fields multiple times.
| Index | Zero-based widget index on the current page (0 .. FormFieldCount - 1). |
Name to dedupe across
pages.fiSignature) expose Name and rect
but no signature bytes; use document-level Signature[I] to obtain
the PKCS#7 content.GroupCount / GroupIndex to
tell them apart.FormFieldCount is 0 and
this indexer is never callable.
var I, J: Integer;
var Info: TPdfFormFieldInfo;
for I := 0 to Pdf1.FormFieldCount - 1 do
begin
Info := Pdf1.FormFieldInfo[I];
Memo1.Lines.Add(Format('%s [%d] export=%s checked=%s',
[Info.Name, Ord(Info.FieldType), Info.ExportValue, BoolToStr(Info.Checked, True)]));
for J := 0 to High(Info.OptionLabels) do
Memo1.Lines.Add(' ' + Info.OptionLabels[J]);
end;