Документация PDFiumVCL

FormFieldCount property

Эта запись API сохраняет идентификаторы, сигнатуры, блоки кода и термины PDF в исходном виде.
Component: TPdf  ·  Unit: PDFium
Number of form field widgets on the currently active page.

Syntax

property FormFieldCount: Integer; // read only

Description

FormFieldCount returns the number of AcroForm field widget annotations on the currently active page. Each entry corresponds to one widget annotation (subtype /Widget with an /FT field type) — text input, check box, radio button, list box, combo box, push button, or signature field (PDF 1.7 spec section 12.7).

The value is 0 when Active is False, when the document is not an AcroForm (FormType = ftNone) or when the page has no interactive widgets. It is a per-page metric; pages can contain widgets that belong to the same logical field defined elsewhere in the document tree — PDF allows one field to have multiple widget placements (e.g. a signature visible on the cover and the last page).

Use FormFieldInfo[Index] with indices from 0 to FormFieldCount - 1 to obtain a TPdfFormFieldInfo record: field type, name, alternate name, flags, option labels, current value, export value, checked state, and font size. To get a field by hit-testing a page coordinate use FormFieldAt[X, Y] or FormFieldInfoAt[X, Y] instead.

Remarks

Example

var I: Integer;
var Info: TPdfFormFieldInfo;
for I := 0 to Pdf1.FormFieldCount - 1 do
begin
  Info := Pdf1.FormFieldInfo[I];
  Memo1.Lines.Add(Format('%s = %s', [Info.Name, Info.ExportValue]));
end;

See Also

FormField, FormFieldInfo, FormType, HasFormFieldAt