PDFium Delphi Component Docs

Form host callbacks

Component: TPdf  ·  Unit: PDFium
Connect PDFium form interaction to host navigation, URI, cursor, change, page, and selection behavior

Properties and events

property FormHostCallbacksComplete: Boolean; // read only

property FormSelectionRects: TPdfFormSelectionRects; // read only

procedure ClearFormSelectionRects;

property OnFormCursor: TPdfFormCursorEvent;

property OnFormValueChange: TPdfFormValueChangeEvent;

property OnFormUriAction: TPdfFormUriActionEvent;

property OnFormGoToAction: TPdfFormGoToActionEvent;

property OnFormSelectionRect: TPdfFormSelectionRectEvent;

Page ownership

Document JavaScript can request a page that no view has opened yet, so the form host loads it lazily, retains one handle per requested page, sends native page-open notifications, and releases every handle before the form environment closes

FormHostCallbacksComplete is true after the form environment has installed every required version-1 callback

Navigation and URI actions

OnFormGoToAction receives a one-based page number, the native zoom mode, and a bounded copy of the destination position array

Leaving GoTo unhandled changes the page of the view that initiated form interaction, falling back to TPdf.PageNumber for headless use; the host may set Handled and apply destination scrolling or zoom itself

OnFormUriAction receives decoded and raw URI values plus keyboard modifiers for both AcroForm and XFA actions, and performs no external launch unless the host chooses to do so

Cursor, changes, and selected rectangles

OnFormCursor receives both a stable TPdfFormCursor value and the original native cursor code; the stable value is one of pfcUnknown, pfcArrow, pfcSizeNESW, pfcSizeNWSE, pfcVerticalBeam, pfcHorizontalBeam, or pfcHand, and leaving it unhandled updates only the view that initiated form interaction

OnFormValueChange runs after invalidating derived page caches and coalesces nested change notifications

FormSelectionRects returns a caller-owned snapshot of up to 4096 page-space rectangles from native form-text selection; OnFormSelectionRect streams each new rectangle and ClearFormSelectionRects clears retained geometry

TPdfFormSelectionRects is the dynamic array behind that property, one TPdfFormSelectionRect entry per reported rectangle carrying its PageNumber and PDF page-space Bounds so a highlight overlay can be painted without tracking form state itself

See Also

FormFieldInfo, FormFieldTypeAtPoint, TPdfView.FormFieldInfoAt