property LinkOptions: TPdfViewLinkOptions;
LinkOptions is a Pascal set of TPdfViewLinkOption. Each
flag toggles automatic handling of one PDF link action type:
PageNumber to the destination on click.ShellExecute on the
URI.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.
Active := True; LinkOptions is published.loAutoOpenURI is the safe choice for embedding in a kiosk or untrusted-document viewer — pair it with OnWebLinkClick that vets the URL before doing anything.
// 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;