Click or drag to resize

NumberTree Class

A NumberTree is a common data structure in PDF. See section 3.8.6 'Number Trees' in PDF Reference Manual for more details. A number tree serves a similar purpose to a dictionary - associating keys and values - but by different means. NumberTrees allow efficient storage of very large association collections(number/Obj* maps). A NumberTree can have many more entries than a SDF/Cos dictionary can.
Inheritance Hierarchy
SystemObject
  pdftron.SDFNumberTree

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

The NumberTree type exposes the following members.

Constructors
  NameDescription
Public methodNumberTree
Create a high level NumberTree wrapper around an existing SDF/Cos NumberTree. This does not copy the object.
Top
Methods
  NameDescription
Public methodClose
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodErase(Int32)
Removes the specified object from the tree. Does nothing if no object with that number exists.
Public methodErase(NumberTreeIterator)
Removes the NumberTree entry pointed by the iterator.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetIterator
Gets the iterator.
Public methodCode exampleGetIterator(Int32)
Search for the specified key in the NumberTree.
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 NumberTree is valid.
Public methodPut
Puts a new entry in the name tree. If an entry with this number is already in the tree, it is replaced.
Public methodSet
Sets value to the specified NumberTree.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
Sample code:
PDFDoc doc = new PDFDoc("../Data/test.pdf");
NumberTree labels = doc.GetRoot().Get("PageLabels").Value());
if (labels.IsValid()) {
    // Traversing the NumberTree
    for (NumberTreeIterator i = labels.GetIterator(); i.HasNext(); i.Next())
        num = i.Key().GetNumber();
}
See Also