PDFium Component Docs

LinkAnnotationAtPos metodă

Component: TPdfView  ·  Unit: PDFium
Returnează indexul adnotării linkului la pixelul de ecran (X, Y), sau -1.

Syntax

function LinkAnnotationAtPos(X, Y: Integer; out PageNumber: Integer): Integer; overload;

 

function LinkAnnotationAtPos(X, Y: Integer): Integer; overload;

Description

Returns the link-annotation index at the screen pixel (X, Y), or -1.

Use to implement a "click-to-follow" UI without enabling LinkOptions auto-handling.

TPdfView maintains the device-to-page transform internally based on Zoom, Rotation, page padding, and scroll offset; these helpers are the safe public interface to that transform.

Remarks

Example

procedure TForm1.PdfView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  PageX, PageY: Double;
begin
  if PdfView1.LinkAnnotationAtPos(X, Y, PageX, PageY) then
    Caption := Format('pt = (%.2f, %.2f)', [PageX, PageY]);
end;

See Also

DeviceToPage, LinkAnnotation, OnAnnotationLinkClick