THotPDF.GetLoadedAnnotationCount Method
Returns the total number of annotations on a specified page in the loaded PDF document, used to determine the iteration range before enumerating annotations
Declaration
function GetLoadedAnnotationCount(PageIndex: Integer): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page, returns 0 if out of range |
Return value
Returns the total number of entries in the specified page's annotation array (Annots); returns 0 if the page has no annotations or the page index is invalid
Usage notes
- 注释计数以页面 Annots 数组中的直接条目数为准,不递归统计嵌套引用
- 结合此方法的返回值与
GetLoadedAnnotationInfo可安全遍历所有注释而不越界 - Form field controls (Widgets) are also annotation types and are included in this count; they should be treated differently from purely presentational annotations