THotPDF.RegisterNamedDestination

THotPDF

 

總覽

在 Catalog /Names /Dests name tree (ISO 32000-1 §12.3.2.3) 中註冊 symbolic destination。GoTo / GoToR actions 與 outline /Dest entries 之後可依 name 參照 destination,而不是硬編碼 page numbers,讓 cross-references 在 page insertion / deletion / reorder 後仍保持穩定/Names /Dests 名稱樹(ISO 32000-1 §12.3.2.3)。GoTo / GoToR 動作與大綱的 /Dest

Delphi 語法:

procedure RegisterNamedDestination(const Name: AnsiString; PageIndex: Integer; FitMode: THPDFDestinationFitMode = dfmFit; Left, Top, Right, Bottom, Zoom: Single = 0);

 

Parameters

Name 是 unique name-tree key(case-sensitive)。PageIndex 為 0-based,且必須指向已建立的頁面(BeginDoc 會建立 page 0;AddPage 會加入 page N)

Name 是名稱樹的唯一鍵(區分大小寫)。PageIndex

FitMode selects the destination shape per Table 151:

   dfmFit — [page /Fit] (whole page)
   dfmFitH — [page /FitH top] (uses Top)
   dfmFitV — [page /FitV left] (uses Left)
   dfmFitR — [page /FitR llx lly urx ury] — HotPDF reorders parameters as Left, Bottom, Right, Top
   dfmFitB — [page /FitB] (PDF 1.1, fit bounding box)
   dfmFitBH — [page /FitBH top] (PDF 1.1)
   dfmFitBV — [page /FitBV left] (PDF 1.1)
   dfmXYZ — [page /XYZ left top zoom] (zero=inherit)

 

Compliance

No PDF/A / PDF/X gate – navigation aids are spec-allowed across all conformance profiles. PDF 1.2 minimum; auto-bumps the document Version unless StrictVersionLock is set.

 

Example

PDF := THotPDF.Create(nil);
PDF.FileName := 'manual.pdf';
PDF.BeginDoc;
PDF.AddPage;
PDF.AddPage;
PDF.RegisterNamedDestination('Chapter1', 0, dfmFit);
PDF.RegisterNamedDestination('Chapter2', 1, dfmFitH, 0, 500);
PDF.RegisterNamedDestination('FAQTop', 2, dfmXYZ, 100, 200, 0, 0, 1.5);
PDF.EndDoc;

 

Availability

HotPDF v2.119.17.