PDFium Component Docs

LinkOptions Eigenschap

Deze API-entry behoudt identifiers, signatures, codeblokken en PDF-termen in hun oorspronkelijke vorm.
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.

Syntaxis

property LinkOptions: TPdfViewLinkOptions;

Beschrijving

LinkOptions is een Pascal set of TPdfViewLinkOption. Elke vlag schakelt automatische afhandeling van één type PDF-linkactie in of uit:

De standaardwaarde is [loAutoGoto, loAutoOpenURI] — veilige paginasprongen en het openen van URL's blijven automatisch, terwijl programmasprongen en sprongen tussen documenten alleen werken als de toepassing daar expliciet voor kiest

Elke linkactie roept ook het bijbehorende OnAnnotationLinkClick-event (geannoteerde /Link-annotaties) of OnWebLinkClick-event (treffers van de web-linkscanner) AAN VOORDAT de automatische handler draait. Zet de Handled-parameter van het event op True om de automatische actie te onderdrukken, of leid de link via een bevestigingsdialoog / beveiligingsbeleid / auditlog.

Opmerkingen

Voorbeeld

// 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;

Zie ook

OnAnnotationLinkClick, OnWebLinkClick, WebLinkAtPos, LinkAnnotationAtPos