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을 사용하세요
| Index | Integer. 평탄화된 named-destination list에서 0 기반 위치입니다. [0, DestinationCount - 1] 범위여야 합니다. 범위를 벗어나면 Handle = nil인 0으로 채워진 record를 반환합니다 |
HasX, HasY, HasZoom은 이러한 component가 없는 "fit page" / "fit width" destination과 명시적 XYZ destination을 구분합니다. 표시된 component만 적용하세요Handle을 확인하세요
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;