DynaPDF.ChangeBookmark
----------------------

Changes an existing bookmark.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [4.0](newinversion40.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.ChangeBookmark"; PDF; BookmarkHandle; Title; Parent; DestPage; Open ) 

**MBS**( **"DynaPDF.ChangeBookmark";** /\* Changes an existing bookmark. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$BookmarkHandle**; /\* The reference number for the bookmark. Either returned by one of the add/insert functions or just counting from 0 to [DynaPDF.GetBookmarkCount](DynaPDFGetBookmarkCount.md)-1. \*/   
**$Title**; /\* New titlee.g. "Hello" \*/   
**$Parent**; /\* New parent bookmark.e.g. -1 \*/   
**$DestPage**; /\* New destination pagee.g. 5 \*/   
**$Open**) /\* Open the bookmark?e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| BookmarkHandle | The reference number for the bookmark. Either returned by one of the add/insert functions or just counting from 0 to [DynaPDF.GetBookmarkCount](DynaPDFGetBookmarkCount.md)-1. | $BookmarkHandle |
| Title | New title | "Hello" |
| Parent | New parent bookmark. | -1 |
| DestPage | New destination page | 5 |
| Open | Open the bookmark? | 0 |

### Result

Returns OK or error.

### Description

Changes an existing bookmark.   
There is no difference between imported bookmarks and bookmarks which were created with DynaPDF. The parameter ABmk requires a valid bookmark handle. A bookmark handle is a simple array index ranging from zero to [DynaPDF.GetBookmarkCount](DynaPDFGetBookmarkCount.md) -1.  
The parameter Title can be "" if it should be deleted. The parameter Open will be ignored if the bookmark contains no children.  
The function does not check whether the destination page exists at the time the bookmark is changed. If the destination page does not exist when file is closed then it will be set to page 1.  
  
To get the handle of a specific bookmark use the functions [DynaPDF.FindBookmark](DynaPDFFindBookmark.md) and [DynaPDF.FindNextBookmark](DynaPDFFindNextBookmark.md) to find the bookmark.  
It is also possible to enumerate all bookmarks by using [DynaPDF.GetBookmarkCount](DynaPDFGetBookmarkCount.md) and [DynaPDF.GetBookmark](DynaPDFGetBookmark.md) until the used bookmark was found (see [DynaPDF.GetBookmark](DynaPDFGetBookmark.md) for further information).  
See also [ChangeBookmark](https://www.monkeybreadsoftware.com/DynaPDF-Manual/ChangeBookmark.shtml) function in DynaPDF manual.

### Examples

Change the bookmark with new title and new page:

 MBS ( "DynaPDF.ChangeBookmark"; $PDF ; $BookmarkHandle ; "Hello World"; $NewParent ; 6; 0 )  
### See also

- [DynaPDF.AddBookmark](DynaPDFAddBookmark.md)
- [DynaPDF.DeleteBookmark](DynaPDFDeleteBookmark.md)
- [DynaPDF.ExchangeBookmarks](DynaPDFExchangeBookmarks.md)
- [DynaPDF.FindBookmark](DynaPDFFindBookmark.md)
- [DynaPDF.FindNextBookmark](DynaPDFFindNextBookmark.md)
- [DynaPDF.GetBookmark](DynaPDFGetBookmark.md)
- [DynaPDF.GetBookmarkCount](DynaPDFGetBookmarkCount.md)
- [DynaPDF.InsertBookmark](DynaPDFInsertBookmark.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetBookmarkDest](DynaPDFSetBookmarkDest.md)

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[DynaPDF.ChangeAnnotPos](DynaPDFChangeAnnotPos.md) - [DynaPDF.ChangeFont](DynaPDFChangeFont.md)

[HTML Version](DynaPDFChangeBookmark.shtml)