PDFium Component Docs

Destination 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
지정한 0 기반 index의 named destination에 대한 TDestination record를 반환합니다. named destination은 PDF 12.3.2절에서 설명하는 문서 catalog의 Dests / Names tree 아래에 정의된 간접 target입니다

구문

property Destination[Index: Integer]: TDestination; // read only

설명

named destination은 PDF document catalog에 저장된 상징적 이름(예: "chap5.fig3")으로, 실제 page-position-zoom tuple에 해석됩니다. 이를 통해 outline, link annotation, external document가 하드코딩된 page coordinate 대신 안정적인 이름으로 target을 참조할 수 있으므로, document를 다시 page 나눔해도 inbound link가 깨지지 않습니다

PDFiumPas는 기존 /Dests dictionary와 최신 /Names /Dests name tree를 하나의 0 기반 list로 평탄화합니다. Destination[Index]는 destination 이름, target page number(1-based), view coordinate(X, Y), zoom factor, 그리고 각 component가 작성자에 의해 명시적으로 설정되었는지 나타내는 Boolean flag를 담은 TDestination record를 반환합니다

DestinationCount로 named destination의 총 개수를 구하고, Destination[I]로 순회하며, target 이름을 이미 알고 있으면 DestinationByName을 사용하세요

매개변수

IndexInteger. 평탄화된 named-destination list에서 0 기반 위치입니다. [0, DestinationCount - 1] 범위여야 합니다. 범위를 벗어나면 Handle = nil인 0으로 채워진 record를 반환합니다

비고

예제

var
  I: Integer;
  Dest: TDestination;
begin
  Pdf1.LoadFromFile('manual.pdf');
  Memo1.Lines.Add(Format('%d named destinations:', [Pdf1.DestinationCount]));
  for I := 0 to Pdf1.DestinationCount - 1 do
  begin
    Dest := Pdf1.Destination[I];
    Memo1.Lines.Add(Format('%s -> page %d (X=%.1f Y=%.1f Zoom=%.2f)',
      [Dest.Name, Dest.PageNumber, Dest.X, Dest.Y, Dest.Zoom]));
  end;
  // Navigate to the first destination
  if Pdf1.DestinationCount > 0 then
    Pdf1.PageNumber := Pdf1.Destination[0].PageNumber;
end;

참고 항목

DestinationCount, DestinationByName, PageNumber, Bookmark, LinkAnnotation