# StructTreeRoot Class

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

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

```java
class StructTreeRoot
```

**Namespace:** `com::datalogics::PDFL`

## 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/Java/APDFL21.0.0PlusP1c/class/Document.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/class/Document.md), [`PDFDict`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/class/PDFDict.md), [`StructElement`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/class/StructElement.md)

## Methods

### addChild

```java
StructElement com.datalogics.PDFL.StructTreeRoot.addChild(String structType)
```

**Parameters**

- `structType` (`String`)

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

### delete

```java
synchronized void com.datalogics.PDFL.StructTreeRoot.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.StructTreeRoot.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.StructTreeRoot.finalize()
```

*protected*

**Returns:** `void`

### findElementFromID

```java
StructElement com.datalogics.PDFL.StructTreeRoot.findElementFromID(String id)
```

**Parameters**

- `id` (`String`)

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

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

### getDocument

```java
Document com.datalogics.PDFL.StructTreeRoot.getDocument()
```

**Returns:** [`Document`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/class/Document.md)

### getKid

```java
StructElement com.datalogics.PDFL.StructTreeRoot.getKid(int index)
```

**Parameters**

- `index` (`int`)

**Returns:** [`StructElement`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/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.

### getKidCount

```java
int com.datalogics.PDFL.StructTreeRoot.getKidCount()
```

**Returns:** `int`

### getPDFDict

```java
PDFDict com.datalogics.PDFL.StructTreeRoot.getPDFDict()
```

**Returns:** [`PDFDict`](https://docs.datalogics.com/apdfl21/Java/APDFL21.0.0PlusP1c/class/PDFDict.md)
