PDFium Component Docs

WebLink 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
페이지에서 자동 감지된 web link의 URL과 bounding rectangle입니다

구문

property WebLink[PageNumber, Index: Integer]: TWebLink; // read only

설명

WebLink returns a TWebLink record for the URL detected at the specified 1-based PageNumber and 0-based Index. The record contains the Url string (typically http://, https://, or mailto:) and a Rectangles array of TPdfRectangle bounding boxes — one rectangle per visual line, since PDFium reports separate rectangles when a single URL wraps onto multiple lines.

Index ranges from 0 to WebLinkCount[PageNumber] - 1 Outside that range PDFium returns an empty record (Url is empty, Rectangles가 nil인 경우). web link detection은 해당 page의 첫 읽기에서 지연 실행되며 page가 다시 로드될 때까지 캐시됩니다. WebLink 자체를 읽는 비용은 scan이 끝난 뒤 O(1)입니다

WebLink complements LinkAnnotation, which surfaces explicit /Link annotations declared by the PDF author. rectangle을 사용해 사용자 지정 renderer에 click-through overlay를 만들거나 추출된 text에서 URL을 강조 표시하세요. 데이터는 read-only입니다 — PDFiumPas는 detection result만 노출하고 modification primitives. To insert real link annotations, use the FPDFPage_CreateAnnot path on the underlying Page handle.

비고

예제

var Link: TWebLink;
var I: Integer;
for I := 0 to Pdf1.WebLinkCount[1] - 1 do
begin
  Link := Pdf1.WebLink[1, I];
  Memo1.Lines.Add(Format('%s  (%d rects)',
    [Link.Url, Length(Link.Rectangles)]));
end;

참고 항목

WebLinkCount, LinkAnnotation, TPdfView.OnWebLinkClick, TPdfView.LinkOptions