PDFium Delphi Component Docs

เมธอด GetLinkedAnnotationIndex

Component: TPdf  ·  Unit: PDFium
ไล่ตามความสัมพันธ์ /Popup หรือ /IRT ของคำอธิบายประกอบบนหน้าปัจจุบัน แล้วคืน page index ของคำอธิบายประกอบที่เชื่อมโยงอยู่

Syntax

function GetLinkedAnnotationIndex(AnnotIndex: Integer; Relationship: TPdfAnnotationRelationship): Integer;

AnnotIndexInteger. ดัชนีของคำอธิบายประกอบบนหน้าปัจจุบันแบบเริ่มที่ 0 ในช่วง 0 .. AnnotationCount - 1 ค่าที่อยู่นอกช่วงจะ raise EPdfError
RelationshipTPdfAnnotationRelationship. parPopup ไล่ตามรายการ /Popup (หน้าต่าง popup ของ markup annotation) ส่วน parInReplyTo ไล่ตามรายการ /IRT (คำอธิบายประกอบที่รายการนี้ตอบกลับ)
ResultInteger. Page index ของคำอธิบายประกอบที่เชื่อมโยงในช่วง 0 .. AnnotationCount - 1 หรือ -1 เมื่อคำอธิบายประกอบไม่มีลิงก์ลักษณะนี้

Description

Markup annotation สามารถอ้างถึงคำอธิบายประกอบอื่นได้ โน้ตข้อความเก็บหน้าต่าง popup ไว้ใน /Popup ส่วน reply จะพกรายการที่ตนตอบกลับไว้ใน /IRT การเรียกนี้คลายการอ้างอิงดังกล่าวผ่าน native interface (FPDFAnnot_GetLinkedAnnot) แล้วแปลง annotation handle ที่เชื่อมโยงกลับเป็นดัชนีคำอธิบายประกอบของหน้าที่ใช้กันทั่วไป ผู้เรียกจึงไปดูรายการนั้นต่อได้ผ่าน Annotation

เมื่อคำอธิบายประกอบไม่มีรายการสำหรับความสัมพันธ์ที่ขอ ผลลัพธ์จะเป็น -1 ซึ่งเป็นกรณีปกติ — คำอธิบายประกอบส่วนใหญ่ไม่มีทั้ง popup และการอ้างอิง reply

ถ้าต้องการไล่ทั้งสายของ reply แทนการเดินทีละขั้น ให้ใช้ GetLinkedAnnotationChain

Remarks

Example

var
  PopupIndex: Integer;
begin
  PopupIndex := Pdf1.GetLinkedAnnotationIndex(3, parPopup);
  if PopupIndex >= 0 then
    Memo1.Lines.Add(Pdf1.Annotation[PopupIndex].ContentsText);
end;

See Also

GetLinkedAnnotationChain, Annotation, AnnotationCount