PDFiumVCL Docs

LinkOptions property

Component: TPdfView  ·  Unit: PDFium
Published set that controls which of PDFium's four link action types the view follows automatically when the user clicks the link.

Syntax

property LinkOptions: TPdfViewLinkOptions;

Description

LinkOptions is a Pascal set of TPdfViewLinkOption. Each flag toggles automatic handling of one PDF link action type:

The default value is [loAutoGoto, loAutoOpenURI] — safe page jumps and URL opens stay automatic, while program-launch and cross-document jumps require the application to opt in explicitly.

Each link action also raises the corresponding OnAnnotationLinkClick (annotated /Link annotations) or OnWebLinkClick (web-link scanner hits) event BEFORE the automatic handler runs. Mark the event's Handled parameter as True to suppress the auto-action, or redirect the link through a confirmation prompt / security policy / audit log.

Remarks

Example

// Safe defaults: auto-follow only in-doc jumps and URIs
PdfView1.LinkOptions := [loAutoGoto, loAutoOpenURI];

// Vet URI clicks before opening
procedure TForm1.PdfView1WebLinkClick(Sender: TObject;
  WebLinkIndex: Integer; const Url: WString;
  var Handled: Boolean);
begin
  if MessageDlg('Open ' + Url + '?',
    mtConfirmation, [mbYes, mbNo], 0) <> mrYes then
    Handled := True; // suppress auto-handling
end;

See Also

OnAnnotationLinkClick, OnWebLinkClick, WebLinkAtPos, LinkAnnotationAtPos