THotPDF.GetLoadedFontCount Method
Returns the total number of font resources referenced by the specified page in the loaded PDF document, used to determine the valid index range before enumerating fonts
Declaration
function GetLoadedFontCount(PageIndex: Integer): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page; returns 0 if out of the valid range |
Return value
Returns the total number of entries in the specified page's font resource dictionary; returns 0 if the page has no font references or the index is invalid
Usage notes
- This count is based on the entries in the page resource dictionary's Font sub-dictionary and excludes fonts inherited from parent nodes of the page tree
- Used together with GetLoadedFontInfo you can enumerate every font on the page
- The same font may be referenced by multiple resource names in the document; this count is for resource names (aliases) rather than unique fonts