PDFium Delphi Component Docs

FormFieldTabOrder method

Component: TPdfView  ·  Unit: PDFium

Returns current-page zero-based widget-field ordinals in the declared PDF tab order, excluding unrelated annotations

Syntax

function FormFieldTabOrder: TPdfIntegerArray; overload;
function FormFieldTabOrder(out Status: TPdfFormTabOrderStatus): TPdfIntegerArray; overload;

Enable AcroForm form filling on an active document or viewer; an empty widget set returns an empty array

Array members are accepted by FocusFormField and FormFieldInfo; they are widget ordinals rather than indexes into the full PDF Annots array

The status overload reports the requested and effective policy, snapshot availability and fallback reason; the original overload uses the same policy and discards status

Declared page policy

TabsWidget traversal
/RRows from top to bottom, then the viewer reading direction within each row
/CColumns in the viewer reading direction, then top to bottom within each column
/SStructure-tree K traversal of OBJR references, followed by unreferenced widgets in annotation-array order
/AAnnotation-array order projected onto widgets
/WWidgets first in annotation-array order; this widget-only API returns the same projection as A

R and C include the page's intrinsic /Rotate and catalog ViewerPreferences.Direction, defaulting to L2R when Direction is absent

Geometry uses display coordinates at 1/64 point resolution, deterministic ties and center-in-anchor grouping for rows or columns; unusually overlapping layouts may be grouped differently by other processors

Tabs is read from the page itself and is not inherited from the page tree; these policies follow ISO 32000-2:2020, section 12.5.1

Fallback and bounds

Missing or unsupported Tabs, unavailable metadata, invalid direction for R/C, malformed structure for S or unsupported geometry return annotation-array widget order with an explicit status reason

A missing structure tree is an empty S traversal, so all widgets form the unstructured tail; UnstructuredWidgetCount reports that tail without declaring a full fallback

Metadata comes from a private serialization of the current native document and is cached for its content revision, including failed snapshots; notified edits invalidate it

The snapshot is limited to 64 MiB, 65536 active objects and object indexes below 65536, 4096 pages, 4096 annotations per page, 65536 annotations overall, depth 64 and 128 MiB of metadata work; decoded object streams allow 8 MiB each and 32 MiB overall

Encrypted snapshots and snapshots requested during page-object editing are unavailable; geometry requires finite nonempty rectangles, positive page dimensions and coordinates or dimensions within 1000000 points

Queries preserve the page, native focus and pending form-edit text, do not run lifecycle actions and retain no native page handles; they use the document's normal thread and callback rules

These wrapper navigation APIs do not replace the native engine's own keyboard-event Tab implementation

Example

Order := PdfView1.FormFieldTabOrder(Status);
if Length(Order) > 0 then
  PdfView1.FocusFormField(Order[0]);

See Also

TPdfFormTabOrderMode, TPdfFormTabOrderStatus, FocusNextFormField, FocusPreviousFormField