THotPDF.RemoveLoadedNameTreeEntry Method
Takes every entry matching a key out of a loaded name tree, and reports whether anything was taken out
Declaration
function RemoveLoadedNameTreeEntry(Tree: THPDFDictionaryObject;
const Key: AnsiString): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Tree | Root node of the name tree, normally the one handed back by GetLoadedNameTree |
Key | The key string whose entries are to go |
Return value
True where at least one matching key/value pair has gone; False otherwise
Usage notes
- Trees with /Kids are walked recursively (capped at 64 levels), so an entry can be taken out at any depth without your knowing how the tree is laid out
- The key and value objects of the removed pairs are freed, and every node touched is marked dirty ready for the next save
- Where a malformed document has left duplicate keys behind, one call does away with the lot