THotPDF.GetLoadedNameTree Method
Returns the loaded document's name-tree category dictionary from the catalog /Names dictionary, optionally creating it on first use
Declaration
function GetLoadedNameTree(const Category: AnsiString;
CreateMissing: boolean): THPDFDictionaryObject;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Category | Name-tree category key in the catalog /Names dictionary, for example Dests, JavaScript, or EmbeddedFiles |
CreateMissing | True to create the /Names dictionary and the category dictionary as new indirect objects when either is absent; False to return nil instead |
Return value
The resolved category dictionary, or nil when it is missing and CreateMissing is False, or when the document has no loaded catalog
Usage notes
- Creation replaces a non-dictionary /Names entry rather than failing, and both the catalog and the /Names dictionary are marked dirty so the change lands in the next incremental update or save
- The returned dictionary is a root node of a name tree; walk or edit it with
InsertLoadedNameTreeEntryandRemoveLoadedNameTreeEntryso key ordering stays valid - Use
GetLoadedNameTreeRootCountto enumerate which categories exist without creating anything