PDFium Delphi Component Docs

LinkOptions Özellik

Component: TPdfView  ·  Unit: PDFium
Kullanıcı bağlantıya tıkladığında görünümün PDFium'ın dört bağlantı eylemi türünden hangilerini otomatik olarak izleyeceğini denetleyen yayımlanmış küme

Syntax

property LinkOptions: TPdfViewLinkOptions;

Description

LinkOptions, Pascal set of TPdfViewLinkOption türündedir. Her bayrak, bir PDF link action türünün otomatik işlenmesini açıp kapatır:

Varsayılan değer [loAutoGoto, loAutoOpenURI]'dir — güvenli sayfa atlamaları ve URL açılışları otomatik kalır; program çalıştırma ve dokümanlar arası atlamalar ise uygulamanın açıkça kabul etmesini gerektirir

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