Class

# PDFTOCEntry

<div class="rst-class">

forsearch

</div>

PDF

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to create a TOC (Table Of Contents) index in the PDF Document.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                     | Type                                       | Read-Only | Shared |
|------------------------------------------|--------------------------------------------|-----------|--------|
| `Bold<pdftocentry.bold>`                 | `Boolean</api/data_types/boolean>`         |           |        |
| `DrawingColor<pdftocentry.drawingcolor>` | `Color</api/data_types/color>`             |           |        |
| `Italic<pdftocentry.italic>`             | `Boolean</api/data_types/boolean>`         |           |        |
| `Page<pdftocentry.page>`                 | `Integer</api/data_types/integer>`         |           |        |
| `Parent<pdftocentry.parent>`             | <span class="title-ref">PDFTOCEntry</span> | ✓         |        |
| `Title<pdftocentry.title>`               | `String</api/data_types/string>`           |           |        |
| `X<pdftocentry.x>`                       | `Integer</api/data_types/integer>`         |           |        |
| `Y<pdftocentry.y>`                       | `Integer</api/data_types/integer>`         |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                    | Parameters                                                                                                                                                                    | Returns                                      | Shared |
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--------|
| `AddEntry<pdftocentry.addentry>`        | `ParamArray</api/language/paramarray>` entry As <span class="title-ref">PDFTOCEntry</span>                                                                                    |                                              |        |
|                                         | entries() As PDFTOCEntry                                                                                                                                                      |                                              |        |
| `Constructor<pdftocentry.constructor0>` | pageNumber As `Integer</api/data_types/integer>`, title As `String</api/data_types/string>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>` |                                              |        |
| `Entries<pdftocentry.entries>`          |                                                                                                                                                                               | <span class="title-ref">PDFTOCEntry()</span> |        |
| `EntryAt<pdftocentry.entryat>`          | index As `Integer</api/data_types/integer>`                                                                                                                                   | <span class="title-ref">PDFTOCEntry</span>   |        |
| `RemoveAt<pdftocentry.removeat>`        | index As `Integer</api/data_types/integer>`                                                                                                                                   |                                              |        |
| `RemoveEntry<pdftocentry.removeentry>`  | entries() As `PDFTOCEntry`                                                                                                                                                    |                                              |        |
|                                         | `ParamArray</api/language/paramarray>` entries As `PDFTOCEntry`                                                                                                               |                                              |        |

## Property descriptions

<div id="pdftocentry.bold">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Bold

**Bold** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, applies the bold style to the entry's text content if any.

<div id="pdftocentry.drawingcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.DrawingColor

**DrawingColor** As `Color</api/data_types/color>`

> The currently selected color for the <span class="title-ref">PDFTOCEntry</span> object. This color will be used when `AddEntry<pdftocentry.addentry>` is called.

<div id="pdftocentry.italic">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Italic

**Italic** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, applies the italic style to the entry's text content if any.

<div id="pdftocentry.page">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Page

**Page** As `Integer</api/data_types/integer>`

> The number of the page associated with this entry.

<div id="pdftocentry.parent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Parent

**Parent** As `PDFTOCEntry</api/pdf/pdftocentry>`

> The parent of this entry.
>
> This property is read-only.

<div id="pdftocentry.title">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Title

**Title** As `String</api/data_types/string>`

> The text for this entry that appears in the table of contents.

<div id="pdftocentry.x">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.X

**X** As `Integer</api/data_types/integer>`

> The location on the X-axis of the page that should be displayed when the user selects the entry.

<div id="pdftocentry.y">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Y

**Y** As `Integer</api/data_types/integer>`

> The location on the Y-axis of the page that should be displayed when the user selects the entry.

## Method descriptions

<div id="pdftocentry.addentry">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.AddEntry

**AddEntry**(`ParamArray</api/language/paramarray>` entry As PDFTOCEntry)

> Creates subentries to the existing entry from the array passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.AddEntry

**AddEntry**(entries() As PDFTOCEntry)

> Creates subentries to the existing entry from the array passed.

<div id="pdftocentry.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Constructor

**Constructor**(pageNumber As `Integer</api/data_types/integer>`, title As `String</api/data_types/string>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a PDF table of contents entry (<span class="title-ref">PDFTOCEntry</span>) from the values passed.

<div id="pdftocentry.entries">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.Entries

**Entries** As PDFTOCEntry()

> Returns all subentries.

<div id="pdftocentry.entryat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.EntryAt

**EntryAt**(index As `Integer</api/data_types/integer>`) As <span class="title-ref">PDFTOCEntry</span>

> Returns the <span class="title-ref">PDFTOCEntry</span> at the *index* specified.

<div id="pdftocentry.removeentry">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.RemoveEntry

**RemoveEntry**(entries() As `PDFTOCEntry</api/pdf/pdftocentry>`)

> Removes the *entires* passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

**RemoveEntry**(`ParamArray</api/language/paramarray>` entries As `PDFTOCEntry</api/pdf/pdftocentry>`)

Removes the *entires* passed.

<div id="pdftocentry.removeat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFTOCEntry.RemoveAt

**RemoveAt**(index As `Integer</api/data_types/integer>`)

> Removes the <span class="title-ref">PDFTOCEntry</span> at the *index* specified.

## Notes

Add a table of contents entry to PDF document using the `PDFDocument.AddTOCEntry<pdfdocument.addtocentry>` method.

## Sample code

This examples creates a table of contents (mainTOC) and an introduction entry (introTOC), adds the introTOC as a subentry to the mainTOC then adds the mainTOC to the `PDFDocument</api/pdf/pdfdocument>`, pdfDOC:

``` xojo
Var mainTOC As New PDFTOCEntry(1, "Chapter 1", 0, 0)
Var introTOC As New PDFTOCEntry(2, "Introduction", 0, 0)
mainTOC.AddEntry(introTOC)
pdfDOC.AddTOCEntry(mainTOC)
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div id="pdftocentry.see_also">

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `PDFDocument</api/pdf/pdfdocument>` class.

</div>

</div>
