PDFium Component Docs

LinkAnnotationCount 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
특정 page의 /Link annotation entry 수입니다

구문

property LinkAnnotationCount[PageNumber: Integer]: Integer; // read only

설명

LinkAnnotationCount는 1-based PageNumber 인자로 지정한 page의 subtype /Link entry 수를 반환합니다 (PDF 1.7 spec section 12.5.6.5). 현재 활성 page에만 제한되고 모든 annotation subtype을 세는 AnnotationCount와 달리, 이 indexed property는 어떤 page든 직접 대상으로 삼아 link annotation만 필터링합니다. 즉 텍스트나 그래픽 주위에 클릭 가능한 영역을 감싸고 destination, URI, launch action, named action을 가리키는 entry입니다

PageNumber1 .. PageCount 범위로 전달하세요. ActiveFalse이거나, page index가 유효하지 않거나, page에 link annotation이 전혀 없으면 값은 0입니다. PDFiumPas는 WebLinkCount를 통해 “auto-detected” web URL도 별도로 제공합니다. 이것들은 text-pattern scanning에서 나오며 LinkAnnotationCount의 일부가 아닙니다

LinkAnnotation[PageNumber, Index]를 사용해 0부터 LinkAnnotationCount[PageNumber] - 1까지의 index로 TLinkAnnotation record를 가져오세요. 여기에는 bounding rectangle, target page number, action type, multi-line link용 quadrilateral point, resolved action payload가 들어 있습니다. link metadata loading은 page당 O(n)이므로 여러 page를 순회할 때는 캐시하세요

비고

예제

var P, I: Integer;
var Link: TLinkAnnotation;
for P := 1 to Pdf1.PageCount do
  for I := 0 to Pdf1.LinkAnnotationCount[P] - 1 do
  begin
    Link := Pdf1.LinkAnnotation[P, I];
    Memo1.Lines.Add(Format('p%d link → page %d', [P, Link.PageNumber]));
  end;

참고 항목

LinkAnnotation, WebLinkCount, AnnotationCount, PageCount