Skip to content
Guides

Bookmarks

Bookmarks are user-created markers, which is used to identify and quickly navigate to specific locations in a document. Unlike outlines, users manually add bookmarks, typically reflecting their personalized interests in the document content.

Bookmarks offer a user-customized navigation method, enabling users to create personalized markers within a document. Users can swiftly navigate to bookmarked locations without the need to browse through the entire document.

Retrieve the list of bookmarks

This example shows how to get the bookmarks list:

java
List<CPDFBookmark> bookmarkList = document.getBookmarks();

Add a New Bookmark

The steps for adding a new bookmark are as follows:

  1. Create a bookmark object.
  2. Set bookmark properties.
  3. Add the bookmark to the document.

This example shows how to add a new bookmark:

java
int pageIndex = 4;
// Create a bookmark object and set its properties.
CPDFBookmark bookmark = new CPDFBookmark(pageIndex, "new bookmark",CPDFDate.toStandardDate(TTimeUtil.getCurrentDate());
// Add the bookmark to the document.
document.addBookmark(bookmark);
kotlin
val pageIndex = 4
// Create a bookmark object and set its properties.
val bookmark = CPDFBookmark(
  pageIndex,
  "new bookmark",
  CPDFDate.toStandardDate(TTimeUtil.getCurrentDate())
)
// Add the bookmark to the document.
document.addBookmark(bookmark)

Delete a Bookmark

Delete the bookmark for a specified page number.

This example shows how to delete a bookmark:

C#
// Delete the bookmark for the first page.
document.removeBookmark(0);