THotPDF.GetLoadedFontInfo Method
Reads the name and encoding information of a specific font resource on a specified page of the loaded PDF, used for checking page font usage or making font replacement decisions
Declaration
function GetLoadedFontInfo(PageIndex, FontIndex: Integer; out AFontName, AEncoding: AnsiString): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
FontIndex | The zero-based index of the target font in the page's font resource dictionary |
AFontName | Out parameter receiving the font's BaseFont name (e.g. ABCDEE+Arial) |
Return value
Returns True if the font information was read successfully
Usage notes
- Call GetLoadedFontCount first to obtain the valid index range
- Returns False when the indices are out of range or the font cannot be read
- To access the font's full properties (Widths, FontDescriptor and so on), call GetLoadedFontDict afterwards