# Bookmark Class

> A bookmark on a page of a PDF document.

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

```csharp
class Bookmark : SystemIDisposable
```

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

**Inherits from:** `SystemIDisposable`

## Description

A bookmark on a page of a PDF document.

Each bookmark has a title that appears on screen, and an action that specifies what happens when a user clicks on the bookmark.

The typical action for a user-created bookmark is to move to another location in the current document, although any action (see Action) can be specified.

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

**Uses types:** [`Action`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Action.md), [`Bookmark`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Bookmark.md), [`BookmarkFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/BookmarkFlags.md), [`Color`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Color.md), [`PDFDict`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PDFDict.md), [`Page`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Page.md), [`ViewDestination`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/ViewDestination.md)

## Properties

### Action

```csharp
Action Datalogics.PDFL.Bookmark.Action { get; set; }
```

Get the Action for a bookmark.

### Color

```csharp
Color Datalogics.PDFL.Bookmark.Color { get; set; }
```

Get the color of the bookmark.

### Count

```csharp
int Datalogics.PDFL.Bookmark.Count { get; }
```

Get the number of open bookmarks in the subtree under this bookmark.

### FirstChild

```csharp
Bookmark Datalogics.PDFL.Bookmark.FirstChild { get; }
```

Gets a bookmark's first child.

### Flags

```csharp
BookmarkFlags Datalogics.PDFL.Bookmark.Flags { get; set; }
```

Get the flags for the bookmark.

### Indent

```csharp
int Datalogics.PDFL.Bookmark.Indent { get; }
```

Get the indentation level of a bookmark in its containing tree.

### LastChild

```csharp
Bookmark Datalogics.PDFL.Bookmark.LastChild { get; }
```

Gets a bookmark's last child.

### Next

```csharp
Bookmark Datalogics.PDFL.Bookmark.Next { get; }
```

Gets a bookmark's next (right) sibling.

### Open

```csharp
bool Datalogics.PDFL.Bookmark.Open { get; set; }
```

Is the bookmark open?

### PDFDict

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

Get the dictionary associated with the bookmark.

### Parent

```csharp
Bookmark Datalogics.PDFL.Bookmark.Parent { get; }
```

Gets a bookmark's parent.

### Previous

```csharp
Bookmark Datalogics.PDFL.Bookmark.Previous { get; }
```

Gets a bookmark's previous (left) sibling.

### Title

```csharp
string Datalogics.PDFL.Bookmark.Title { get; set; }
```

The title of the bookmark.

### ViewDestination

```csharp
ViewDestination Datalogics.PDFL.Bookmark.ViewDestination { get; }
```

If this bookmark has a GoTo action, then return the destination of the action, else return null.

## Methods

### AddChild

```csharp
void Datalogics.PDFL.Bookmark.AddChild(Bookmark child)
```

**Parameters**

- `child` ([`Bookmark`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Bookmark.md)): the bookmark being added.

**Returns:** `void`

Add an existing bookmark to be the child bookmark of a parent.

### AddNextSibling

```csharp
void Datalogics.PDFL.Bookmark.AddNextSibling(Bookmark NewRightSibling)
```

**Parameters**

- `NewRightSibling` ([`Bookmark`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Bookmark.md)): The bookmark to become the new right sibling.

**Returns:** `void`

Add a bookmark to a tree as the next (right) sibling.

### AddPreviousSibling

```csharp
void Datalogics.PDFL.Bookmark.AddPreviousSibling(Bookmark NewLeftSibling)
```

**Parameters**

- `NewLeftSibling` ([`Bookmark`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Bookmark.md)): The bookmark to become the new left sibling.

**Returns:** `void`

Add a bookmark to a tree as the previous (left) sibling.

### AddSubtree

```csharp
void Datalogics.PDFL.Bookmark.AddSubtree(Bookmark subtree, string title)
```

**Parameters**

- `subtree` ([`Bookmark`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Bookmark.md)): The bookmark subtree to add.
- `title` (`string`): the title of the newly added subtree.

**Returns:** `void`

Add a copy of a subtree as the new last child of a parent bookmark, and gives the subtree an initial title.

### CreateNewChild

```csharp
Bookmark Datalogics.PDFL.Bookmark.CreateNewChild(Page page, string title)
```

**Parameters**

- `page` ([`Page`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Page.md)): The PDF page of the new child bookmark.
- `title` (`string`): The initial title of the new child bookmark.

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

The newly created child bookmark.

(Deprecated, function may be removed in the future, use single-parameter CreateNewChild() method instead) Create a bookmark and add to a parent as the last child bookmark, and give the new bookmark an initial title.

### CreateNewChild

```csharp
Bookmark Datalogics.PDFL.Bookmark.CreateNewChild(string title)
```

**Parameters**

- `title` (`string`): The initial text of the new child bookmark.

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

The newly created child bookmark.

Create a new bookmark and add to a parent as the last child bookmark, using supplied string as the initial text.

### CreateNewSibling

```csharp
Bookmark Datalogics.PDFL.Bookmark.CreateNewSibling(string title)
```

**Parameters**

- `title` (`string`): The initial text for the new right sibling.

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

The newly created sibling bookmark.

Create a new bookmark in a tree as the next (right) sibling, using supplied string as the initial text.

### Destroy

```csharp
void Datalogics.PDFL.Bookmark.Destroy()
```

**Returns:** `void`

Removes a bookmark subtree from the bookmark tree containing it.

### Dispose

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

**Returns:** `void`

### Equals

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

**Parameters**

- `obj` (`object`)

**Returns:** `override bool`

### FindDescendentBookmark

```csharp
Bookmark Datalogics.PDFL.Bookmark.FindDescendentBookmark(string title)
```

**Parameters**

- `title` (`string`): The title of the bookmark for which to search.

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

The bookmark within this bookmark's tree that has the supplied title. Returns NULL if there is no bookmark with the supplied title.

Find bookmark by its title within the subtree of which this bookmark is the root, searching within the entire subtree.

### FindDescendentBookmark

```csharp
Bookmark Datalogics.PDFL.Bookmark.FindDescendentBookmark(string title, int maxDepth)
```

**Parameters**

- `title` (`string`): The title of the bookmark for which to search.
- `maxDepth` (`int`): If supplied, declares the number of levels below this bookmark to search. (If omitted, the entire subtree is searched.)

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

The bookmark within this bookmark's tree that has the supplied title. Returns NULL if there is no bookmark with the supplied title.

Find bookmark by its title within the subtree of which this bookmark is the root, searching within the subtree to a depth determined by maxDepth (e.g., 0 = this bookmark only and not any of its children, 1 = search one level below this bookmark level, etc.)

### HasChildren

```csharp
bool Datalogics.PDFL.Bookmark.HasChildren()
```

**Returns:** `bool`

true if the bookmark has children.

Does the bookmark have children?

### IsOpen

```csharp
bool Datalogics.PDFL.Bookmark.IsOpen()
```

**Returns:** `bool`

true if the bookmark is open.

Is the bookmark open?

### ToString

```csharp
override string Datalogics.PDFL.Bookmark.ToString()
```

**Returns:** `override string`

A string describing this Bookmark and its properties.

Returns a string representation of this Bookmark.

The string includes the title, color, flags, count, indent level, open state, and view destination if available.

### Unlink

```csharp
void Datalogics.PDFL.Bookmark.Unlink()
```

**Returns:** `void`

Unlinks the bookmark from the bookmark tree that contains it and adjusts the tree appropriately.
