function GetLinkedAnnotationChain(AnnotIndex: Integer; Relationship: TPdfAnnotationRelationship; MaxDepth: Integer = 64): TPdfIntegerArray;
| AnnotIndex | Integer index ของ annotation เริ่มต้นบนหน้าปัจจุบันแบบเริ่มที่ 0 ในช่วง 0 .. AnnotationCount - 1 |
| Relationship | TPdfAnnotationRelationship parPopup ไล่ตาม entry /Popup ส่วน parInReplyTo ไล่ตาม entry การตอบกลับ /IRT |
| MaxDepth | Integer จำนวน link สูงสุดที่จะไล่ตาม ต้องอยู่ระหว่าง 1 ถึง 4096 มิฉะนั้นจะเกิด EPdfError ค่าเริ่มต้นคือ 64 |
| Result | TPdfIntegerArray index หน้าของ annotation ที่เชื่อมกัน เรียงตามลำดับที่ไปเยือน จะว่างเปล่าเมื่อ annotation เริ่มต้นไม่มี link แบบนี้ |
เรียก GetLinkedAnnotationIndex ซ้ำ ๆ: จาก annotation เริ่มต้นจะไล่ตามความสัมพันธ์ที่ระบุไปยัง annotation ถัดไป แล้วทำซ้ำจากตัวนั้นต่อไป โดยเก็บ index ทุกตัวที่ผ่าน ผลลัพธ์คือเธรดการตอบกลับของการสนทนา หรือสาย popup chain ในรูปอาร์เรย์ index ของ annotation บนหน้าธรรมดา
การไล่หยุดเมื่อครบหนึ่งในสามเงื่อนไข: annotation ปัจจุบันไม่มี link ต่อ, จำนวน link ที่ไปเยือนถึง MaxDepth หรือ index ถัดไปจะกลับไปเจอ annotation ที่เคยเห็นแล้ว (index เริ่มต้นนับว่าเห็นแล้วด้วย) กลไกกันวนลูปนี้ทำให้การเรียกปลอดภัยกับเอกสารที่เสียโครงซึ่ง entry /IRT วนกลับมาที่เดิม
index เริ่มต้นไม่เคยอยู่ในผลลัพธ์ — มีเพียง annotation ที่มันชี้ไปถึงเท่านั้น annotation ที่ไม่มี link ตามที่ระบุจะให้อาร์เรย์ว่าง ไม่ใช่ error
MaxDepth ที่อยู่นอก 1 .. 4096 จะเกิด EPdfError ก่อนที่ annotation ใดจะถูกเปิด
var
Chain: TPdfIntegerArray;
Index: Integer;
begin
// collect the whole reply thread under annotation 5
Chain := Pdf1.GetLinkedAnnotationChain(5, parInReplyTo);
for Index in Chain do
Memo1.Lines.Add(Pdf1.Annotation[Index].ContentsText);
end;