PDFium Component Docs

DestinationCount 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
문서에 선언된 named destination 수입니다

구문

property DestinationCount: Integer; // read only

설명

DestinationCount는 문서에 등록된 named destination 수를 반환합니다. 즉 catalog의 /Dests dictionary 또는 그 /Names /Dests name tree(PDF 1.7 spec 12.3.2.3절)를 통해 도달할 수 있는 entry입니다. named destination은 문자열 label을 target page, viewport rectangle, 선택적 zoom factor에 연결하며, bookmark, link annotation, remote-goto action은 destination을 inline 또는 이름으로 참조합니다

ActiveFalse이거나 named destination이 선언되지 않았으면 값은 0입니다(link와 bookmark는 inline explicit destination으로 계속 동작할 수 있지만, 이 count에는 "named" 형태만 포함됩니다). 0부터 DestinationCount - 1까지의 index로 Destination[Index]를 사용하면 TDestination record(handle, name, page number, X/Y/Zoom, 그리고 어떤 field가 명시적으로 저장되었는지 나타내는 has-flag)를 얻을 수 있습니다

PDFium은 매번 name tree를 순회하므로 접근 비용은 access당 O(n)입니다. 이름으로 반복 조회할 때는 수동 loop보다 DestinationByName[Name]을 선호하세요 — PDFium은 내부적으로 balanced-tree search를 수행하므로 linear scan보다 더 잘 확장됩니다

비고

예제

var I: Integer;
var D: TDestination;
for I := 0 to Pdf1.DestinationCount - 1 do
begin
  D := Pdf1.Destination[I];
  Memo1.Lines.Add(Format('%s → page %d', [D.Name, D.PageNumber]));
end;

참고 항목

Destination, DestinationByName, Bookmarks, LinkAnnotationCount