function GetLinkedAnnotationIndex(AnnotIndex: Integer; Relationship: TPdfAnnotationRelationship): Integer;
| AnnotIndex | Integer。目前頁面上註解的自零起算索引,範圍為 0 .. AnnotationCount - 1。超出範圍的索引會引發 EPdfError |
| Relationship | TPdfAnnotationRelationship。parPopup 沿 /Popup 項目(標記註解的彈出視窗);parInReplyTo 沿 /IRT 項目(此註解所回覆的對象) |
| Result | Integer。連結註解在 0 .. AnnotationCount - 1 範圍內的頁面索引;註解沒有此類連結時為 -1 |
標記註解可以參照其他註解。文字備註會在 /Popup 保留彈出視窗,回覆則在 /IRT 攜帶它所回覆的註解。此呼叫透過原生介面(FPDFAnnot_GetLinkedAnnot)解析這類參照,並把連結註解控制代碼轉換回其他 API 通用的頁面註解索引,讓呼叫端能透過 Annotation 檢視
當註解沒有所要求關聯的項目時,結果為 -1。這是正常情況 — 大多數註解既沒有彈出視窗,也沒有回覆參照
要走訪整條回覆串而非單一步進,請使用 GetLinkedAnnotationChain
AnnotIndex 使用同一份 AnnotationCount 清單進行索引
var
PopupIndex: Integer;
begin
PopupIndex := Pdf1.GetLinkedAnnotationIndex(3, parPopup);
if PopupIndex >= 0 then
Memo1.Lines.Add(Pdf1.Annotation[PopupIndex].ContentsText);
end;