Show / Hide Table of Contents

# Class STree

STree is the root of the structure tree, which is a central repository for information related to a PDF document's logical structure. There is at most one structure tree in each document.

##### Inheritance

object
STree

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: pdftron.PDF.Struct

###### Assembly: PDFNet.dll

##### Syntax

    public class STree : IDisposable

### Constructors

#### STree(PDFDoc)

##### Declaration

    public STree(PDFDoc doc)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFDoc | doc |

#### STree(Obj)

Initialize a STree using an existing low-level Cos/SDF object.

##### Declaration

    public STree(Obj struct_dict)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | struct_dict | a low-level (SDF/Cos) dictionary representing the .

##### Remarks

This constructor does not copy any data, but is instead the logical equivalent of a type cast.

### Methods

#### Dispose()

Releases all resources used by the Stree

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~STree()

##### Declaration

    protected ~STree()

#### GetElement(byte[])

Gets the element.

##### Declaration

    public SElement GetElement(byte[] buf)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | buf | the id_buf

##### Returns

Type | Description
--- | ---
SElement | the element

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetKid(int)

Gets the kid.

##### Declaration

    public SElement GetKid(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index | The index of the kid to obtain.

##### Returns

Type | Description
--- | ---
SElement | The kid at an array index in the structure tree root.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetNumKids()

Gets the num kids.

##### Declaration

    public int GetNumKids()

##### Returns

Type | Description
--- | ---
int | The number of kids of the structure tree root.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSDFObj()

Gets the SDFObj.

##### Declaration

    public Obj GetSDFObj()

##### Returns

Type | Description
--- | ---
Obj | Pointer to the underlying SDF/Cos object.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Insert(SElement, int)

Inserts the specified kid element after the given position as a kid of the specified structure tree root.

##### Declaration

    public void Insert(SElement kid, int insert_before)

##### Parameters

Type | Name | Description
--- | --- | ---
SElement | kid | the kid element
int | insert_before | The position after which the kid is inserted. If element currently has no kids, insert_before is ignored.

#### IsValid()

Checks if is valid.

##### Declaration

    public bool IsValid()

##### Returns

Type | Description
--- | ---
bool | true if this is a valid STree object, false otherwise.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable