PDFium Delphi Component Docs

OnFormUriAction event

Component: TPdf  ·  Unit: PDFium
Fires when a form field raises a URI action

Syntax

property OnFormUriAction: TPdfFormUriActionEvent read FOnFormUriAction write FOnFormUriAction;

Description

OnFormUriAction fires when the interactive form layer raises a URI action, for instance from a form button or a script navigation. The handler receives the decoded Uri as WString, the raw bytes as RawUri, keyboard Modifiers, and a var Handled flag

Set Handled = True to navigate with host policy and suppress default processing

Remarks

    • Handler signature: procedure(Sender: TObject; const Uri: WString; const RawUri: AnsiString; Modifiers: Integer; var Handled: Boolean) of object
    • The decoded Uri round-trips through UTF-8 and falls back to the raw ANSI bytes when decoding is lossy
    • For link annotations on page content use TPdfView.OnWebLinkClick instead

Example

procedure TMain.Pdf1FormUriAction(Sender: TObject; const Uri: WString; const RawUri: AnsiString; Modifiers: Integer; var Handled: Boolean);
begin
  OpenInSandboxedBrowser(Uri);
  Handled := True;
end;

See Also