Click or drag to resize

NameTree Class

A NameTree is a common data structure in PDF. See section 3.8.5 'Name Trees' in PDF Reference Manual for more details. A name tree serves a similar purpose to a dictionary - associating keys and values - but by different means. NameTrees allow efficient storage of very large association collections(string/Obj* maps). A NameTree can have many more entries than a SDF/Cos dictionary can. NameTrees use SDF/Cos-style strings(not null-terminated C strings), which may use Unicode encoding etc.
Inheritance Hierarchy
SystemObject
  pdftron.SDFNameTree

Namespace:  pdftron.SDF
Assembly:  pdftron (in pdftron.dll) Version: 255.255.255.255
Syntax
public sealed class NameTree : IClosable

The NameTree type exposes the following members.

Constructors
  NameDescription
Public methodNameTree
Create a high level NameTree wrapper around an existing SDF/Cos NameTree. This does not copy the object.
Top
Methods
  NameDescription
Public methodClose
Public methodStatic memberCreate
Retrieves the NameTree inside the '/Root/Names' dictionary with the specified key name, or creates it if it does not exist.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodErase(Byte)
Removes the specified object from the tree. Does nothing if no object with that name exists.
Public methodErase(NameTreeIterator)
Removes the NameTree entry pointed by the iterator.
Public methodStatic memberFind
Retrieves a name tree, with the given key name, from the '/Root/Names' dictionary of the doc.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodCode exampleGetIterator
Gets the iterator.
Public methodCode exampleGetIterator(Byte)
Search for the specified key in the NameTree.
Public methodGetSDFObj
Gets the SDFObj.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Gets a value that is associated with the given key.
Public methodIsValid
Checks if this NameTree is valid.
Public methodPut
Puts a new entry in the name tree. If an entry with this key is already in the tree, it is replaced.
Public methodSet
Sets value to the specified NameTree
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
PDFDoc doc = new PDFDoc("../Data/PDFReference.pdf");
NameTree dests = NameTree.Find(doc.GetSDFDoc(), "Dests");
if (dests.IsValid()) {
    // Traversing the NameTree
    for (DictIterator i = dests.GetIterator(); i.HasNext(); i.Next())
        string key = i.Key().GetAsPDFText(); // ...
}
See Also