THotPDF.GetLoadedAnnotationInfo Method
Lit le sous-type et le rectangle de position d'une annotation sur une page spécifiée du PDF chargé, ce qui facilite le filtrage rapide et la localisation d'une annotation spécifique sans analyser le dictionnaire complet
Déclaration
function GetLoadedAnnotationInfo(PageIndex, AnnotationIndex: Integer; out ASubtype: AnsiString; out ARect: THPDFRect): boolean;
Unité
HPDFDoc
Paramètre
| Nom | Utilisation |
|---|---|
PageIndex | Index basé sur zéro de la page cible |
AnnotationIndex | Index basé sur zéro de l'annotation cible dans le tableau Annots de la page |
ASubtype | 输出参数,接收注释的 Subtype 字符串,如 Text、Link、Widget |
ARect | Paramètre de sortie, reçoit le rectangle de position de l'annotation sur la page (système de coordonnées PDF) |
Valeur de retour
若成功读取注释信息则返回 True,索引越界或注释解析失败时返回 False,且输出参数值未定义
Notes d'utilisation
- 调用前应先通过
GetLoadedAnnotationCount获取有效索引范围,避免越界访问 - 返回
False时,ASubtype和ARect的内容不可信,不得使用 - 如需访问注释的完整属性(如颜色、内容文本、动作),应进一步调用
GetLoadedAnnotationDict获取字典对象