# NameTree Class

> The name tree is a common data structure in PDF files.

- Product: Adobe PDF Library 21
- Language: .NET Framework
- Version: APDFL21.0.0PlusP1e
- HTML page: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/NameTree
- Version index: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/llms.txt

```csharp
class NameTree : SystemIDisposable
```

**Namespace:** `Datalogics::PDFL`

**Inherits from:** `SystemIDisposable`

## Description

The name tree is a common data structure in PDF files.

A name tree is a type of dictionary that can store many more pairs of matched records than a standard object dictionary.

A name tree uses keys that are character strings to map to data objects. The strings can use a standard coding format, such as Unicode, are sorted in order in the data structure, and can be associated with any type of object.

**Referenced by:** [`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md), [`PDFDict`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFDict.md), [`PDFObject`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFObject.md), [`PDFObjectEnumProc`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFObjectEnumProc.md), [`PDFString`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFString.md)

## Constructors

### NameTree

```csharp
Datalogics.PDFL.NameTree.NameTree(Document doc)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)): The Document in which to create the NameTree.

Creates a new, empty NameTree in the specified Document.

## Properties

### PDFDict

```csharp
PDFDict Datalogics.PDFL.NameTree.PDFDict { get; }
```

Gets the underlying PDFDict of this NameTree.

## Methods

### Dispose

```csharp
void Datalogics.PDFL.NameTree.Dispose()
```

**Returns:** `void`

### EnumEntries

```csharp
void Datalogics.PDFL.NameTree.EnumEntries(PDFObjectEnumProc enumProc)
```

**Parameters**

- `enumProc` ([`PDFObjectEnumProc`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFObjectEnumProc.md)): A user-supplied callback to call for each indirect object in dP. Enumeration ends when enumProc returns false or all indirect objects have been enumerated. The value parameter returned in enumProc is always null.

**Returns:** `void`

Enumerates all the entries of this NameTree.

This method does not enumerate invalid objects, which include objects that are defined as null, objects that are not defined at all (those having no cross-reference entry), and objects that are on the free list.

This re-raises any exception that enumProc raises.

### Equals

```csharp
override bool Datalogics.PDFL.NameTree.Equals(object obj)
```

**Parameters**

- `obj` (`object`)

**Returns:** `override bool`

### Get

```csharp
PDFObject Datalogics.PDFL.NameTree.Get(PDFString key)
```

**Parameters**

- `key` ([`PDFString`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFString.md)): The name of the PDFObject to get from the tree.

**Returns:** [`PDFObject`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFObject.md)

- The PDFObject value corresponding to the supplied key

Retrieves an entry from this NameTree.

### Put

```csharp
void Datalogics.PDFL.NameTree.Put(PDFString key, PDFObject value)
```

**Parameters**

- `key` ([`PDFString`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFString.md)): The name of the PDFObject to put in the tree.
- `value` ([`PDFObject`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFObject.md)): The PDFObject to be associated with key.

**Returns:** `void`

Puts a new entry in this NameTree. If an entry with this name is already in the tree, it is replaced.

### Remove

```csharp
void Datalogics.PDFL.NameTree.Remove(PDFString key)
```

**Parameters**

- `key` ([`PDFString`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFString.md)): The name of the PDFObject to remove from the tree.

**Returns:** `void`

Removes the specified PDFObject from this NameTree. It does nothing if no PDFObject of that name exists in this NameTree.
