property HasFormFieldAt[X, Y: Single]: Boolean; // read only
HasFormFieldAt performs a hit-test on the currently active page: it returns
True when the given (X, Y) coordinate falls inside any
widget annotation rectangle. Coordinates are in PDF user space — same coordinate
system as PageWidth / PageHeight, with the origin at the
bottom-left, X increasing rightward, Y increasing upward, units in points
(1/72 inch).
The property returns False when Active is False,
when the document has no AcroForm widgets, or when the supplied coordinate misses
every widget rectangle. It is a constant-time wrapper around PDFium’s
FPDFPage_HasFormFieldAtPoint — ideal for mouse-move / hover
feedback in a viewer where the value is queried many times per second.
The hit-test honours widget rectangle only — not appearance bounds. Push
buttons or check boxes whose visible glyph is smaller than the widget rect still
report True for the whole rect. Pair with
FormFieldInfoAt[X, Y] to obtain the matched field’s record once the
hit-test confirms the cursor is over a field; that pattern avoids the heavier
info-fetch on every mouse-move event.
TPdfView.DeviceToPage or apply the inverse Zoom / scroll offset
yourself before calling this property.FormFieldInfoAt when
you need to know which field was hit.
procedure TForm1.PdfView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var PageX, PageY: Double;
begin
PdfView1.DeviceToPage(X, Y, PageX, PageY);
if Pdf1.HasFormFieldAt[PageX, PageY] then
PdfView1.Cursor := crHandPoint
else
PdfView1.Cursor := crDefault;
end;