PDFium Delphi Component Docs

FormSelectionRects property

Component: TPdf  ·  Unit: PDFium
Lists the selection rectangles reported by the form layer for the focused field

Syntax

property FormSelectionRects: TPdfFormSelectionRects read GetFormSelectionRects;

Description

FormSelectionRects returns the accumulated TPdfFormSelectionRect array that the form layer reported since the last clear; each entry carries a one-based PageNumber and page-space Bounds

Duplicate consecutive rectangles are suppressed, so the array contains one entry per distinct selection rectangle

Remarks

    • Rectangles accumulate as the user changes the selection; call ClearFormSelectionRects to reset before drawing overlays
    • Each new rectangle is also announced live through OnFormSelectionRect
    • The getter returns a copy, so the caller owns the returned array

Example

for R in Pdf1.FormSelectionRects do
  DrawFocusRing(R.PageNumber, R.Bounds);

See Also