# StructTreeRoot Class

> Internal wrapper for the root of a PDF logical structure tree.

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

```csharp
class StructTreeRoot : SystemIDisposable
```

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

**Inherits from:** `SystemIDisposable`

## Description

Internal wrapper for the root of a PDF logical structure tree.

Owns a non-owning reference to its CDocument. The underlying PDF structure tree is owned by the document; this wrapper provides C++ access to catalog-level struct tree operations (add children, access the backing dict).

**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), [`StructElement`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/StructElement.md)

## Properties

### Document

```csharp
Document Datalogics.PDFL.StructTreeRoot.Document { get; }
```

### KidCount

```csharp
int Datalogics.PDFL.StructTreeRoot.KidCount { get; }
```

### PDFDict

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

## Methods

### AddChild

```csharp
StructElement Datalogics.PDFL.StructTreeRoot.AddChild(string structType)
```

**Parameters**

- `structType` (`string`)

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

### Dispose

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

**Returns:** `void`

### FindElementFromID

```csharp
StructElement Datalogics.PDFL.StructTreeRoot.FindElementFromID(string id)
```

**Parameters**

- `id` (`string`)

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

Element whose /ID matches `id`, or nullptr if none exists.

### GetKid

```csharp
StructElement Datalogics.PDFL.StructTreeRoot.GetKid(int index)
```

**Parameters**

- `index` (`int`)

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

Kid at `index`. The tree root's /K array is restricted to struct elements (not MCRs / OBJRs), so this always returns an element. Caller owns the returned pointer.
