PDFium Component Docs

LinkOptions eigenschap

Component: TPdfView  ·  Unit: PDFium
Gepubliceerde verzameling die bepaalt welke van de vier linkactietypes van PDFium de weergave automatisch volgt wanneer de gebruiker op de link klikt

Syntax

property LinkOptions: TPdfViewLinkOptions;

Description

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

De standaardwaarde is [loAutoGoto, loAutoOpenURI] — veilige paginasprongen en URL-opens blijven automatisch, terwijl programma-start en cross-document-sprongen vereisen dat de toepassing zich expliciet aanmeldt.

Elke linkactie genereert ook de overeenkomstige OnAnnotationLinkClick- (geannoteerde /Link-annotaties) of OnWebLinkClick- (weblink-scanner-treffers) gebeurtenis VOORDAT de automatische afhandelingsroutine draait. Markeer de parameter Handled van de gebeurtenis als True om de auto-actie te onderdrukken, of leid de link om via een bevestigingsprompt / beveiligingsbeleid / auditlog.

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