# PdfBookmarkEditSession

Transactional add/remove/rename/move/nest/retarget/rebuild surface for existing bookmarks.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfBookmarkEditSession.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L44)

**Modifiers**

sealed

Transactional add/remove/rename/move/nest/retarget/rebuild surface for existing bookmarks.

## Inheritance

- object
- PdfBookmarkEditSession

## Remarks

Native page coordinates use default user-space units: one unit is /UserUnit physical points (1/72 inch each), defaulting to 1. Local text/font and matrix values retain their native coordinate spaces. Explicit visual projections use their documented coordinates.

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Method [PdfBookmarkEditSession.Move](/api/pdf/officeimo-pdf-pdfbookmarkeditsession/#method-move-string-string-int32)
- Method [PdfBookmarkEditSession.RebuildFromHeadings](/api/pdf/officeimo-pdf-pdfbookmarkeditsession/#method-rebuildfromheadings)
- Method [PdfBookmarkEditSession.Remove](/api/pdf/officeimo-pdf-pdfbookmarkeditsession/#method-remove-string)
- Method [PdfBookmarkEditSession.Rename](/api/pdf/officeimo-pdf-pdfbookmarkeditsession/#method-rename-string-string)
- Method [PdfBookmarkEditSession.Retarget](/api/pdf/officeimo-pdf-pdfbookmarkeditsession/#method-retarget-string-int32-nullable-system-double)

### Accepted by parameters 1

- Method [PdfDocumentBookmarks.Edit](/api/pdf/officeimo-pdf-pdfdocumentbookmarks/#method-edit-action-officeimo-pdf-pdfbookmarkeditsession) parameter `edit`

Filter members 

Show inherited

## Methods

`public PdfBookmarkNode Add(string title, int pageNumber, string? parentId = null, double? destinationTop = null, bool expanded = true)` [#](#method-add-string-int32-string-nullable-system-double-boolean)

[PdfBookmarkEditSession.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L44)

Adds a bookmark at the root or below a parent id.

Parameters

**title string required**

**pageNumber int required**

**parentId string? = null optional**

**destinationTop double? = null optional**

**expanded bool = true optional**

Returns

`PdfBookmarkNode`

`public PdfBookmarkEditSession Move(string id, string? parentId = null, int index = -1)` [#](#method-move-string-string-int32)

[PdfBookmarkEditSession.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L52)

Moves a bookmark to a root or nested sibling position.

Parameters

**id string required**

**parentId string? = null optional**

**index int = -1 optional**

Returns

`PdfBookmarkEditSession`

`public PdfBookmarkEditSession RebuildFromHeadings()` [#](#method-rebuildfromheadings)

[PdfBookmarkEditSession.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L66)

Replaces bookmarks with the source document's inferred heading hierarchy.

Returns

`PdfBookmarkEditSession`

`public PdfBookmarkEditSession Remove(string id)` [#](#method-remove-string)

[PdfBookmarkEditSession.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L47)

Removes a bookmark and its descendants.

Parameters

**id string required**

Returns

`PdfBookmarkEditSession`

`public PdfBookmarkEditSession Rename(string id, string title)` [#](#method-rename-string-string)

[PdfBookmarkEditSession.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L49)

Renames a bookmark.

Parameters

**id string required**

**title string required**

Returns

`PdfBookmarkEditSession`

Retarget 2 overloads

`public PdfBookmarkEditSession Retarget(string id, int pageNumber, double? destinationTop = null)` [#](#method-retarget-string-int32-nullable-system-double)

[PdfBookmarkEditSession.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L61)

Retargets a bookmark to a page and optional top coordinate.

Parameters

**id string required**

**pageNumber int required**

**destinationTop double? = null optional**

Returns

`PdfBookmarkEditSession`

`public PdfBookmarkEditSession Retarget(string id, int pageNumber, PdfOpenActionDestinationMode destinationMode, double? destinationTop = null, double? destinationLeft = null, double? destinationBottom = null, double? destinationRight = null, double? destinationZoom = null)` [#](#method-retarget-string-int32-officeimo-pdf-pdfopenactiondestinationmode-nullable-system-double-nullable-system-double-nullable-system-double-nullable-system-double-nullable-system-double)

[PdfBookmarkEditSession.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L63)

Retargets a bookmark using an explicit viewer destination mode and coordinates.

Parameters

**id string required**

**pageNumber int required**

**destinationMode OfficeIMO.Pdf.PdfOpenActionDestinationMode required**

**destinationTop double? = null optional**

**destinationLeft double? = null optional**

**destinationBottom double? = null optional**

**destinationRight double? = null optional**

**destinationZoom double? = null optional**

Returns

`PdfBookmarkEditSession`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<PdfBookmarkNode> Roots { get; }` [#](#property-roots)

[PdfBookmarkEditSession.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfBookmarkEditSession.cs#L41)

Current top-level bookmark nodes.

<!-- PowerForge markdown artifact sha256:A527C7DC2B1B68F88BFE67B5FB988696042C981F7AB2287EE48CD3BA8D96EBE4 -->
