Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

BookmarkOptions Class

Represents settings which define the appearance of bookmarks in the document.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v20.2.Core.dll


public class BookmarkOptions :


Visualize the Bookmark

Use the following properties to highlight bookmarks:

  • Visibility - to enable/disable bookmark highlighting;
  • Color - to set the highlighting color.

With these properties specified, the bookmarks are displayed the following way:


using DevExpress.XtraRichEdit;
using System.Drawing;

using (var wordProcessor = new RichEditDocumentServer())
  BookmarkOptions bookmarkOptions = wordProcessor.Options.Bookmarks;
  bookmarkOptions.Visibility = RichEditBookmarkVisibility.Visible;
  bookmarkOptions.Color = Color.Sienna;

Export Bookmarks to the PDF format

You can specify what bookmarks can be displayed in the Bookmarks panel when you export the document to PDF format. Set the DisplayBookmarksInPdfNavigationPane property to one of the PdfBookmarkDisplayMode enumeration values, as shown below:

using DevExpress.XtraRichEdit;

using (var wordProcessor = new RichEditDocumentServer())
    BookmarkOptions bookmarkOptions = wordProcessor.Options.Bookmarks;
    bookmarkOptions.DisplayBookmarksInPdfNavigationPane =

Use the DisplayUnreferencedPdfBookmarks property to determine whether to show bookmarks without references (i.e., without hyperlinks anchored to these bookmarks) in the Bookmarks navigation pane. The DisplayBookmarksInPdfNavigationPane property set PdfBookmarkDisplayMode.None controls the unreferenced bookmarks when the DisplayUnreferencedPdfBookmarks property is set to true.

Resolve Name Conflicts

If a new bookmark name duplicates the existing one, an InvalidOperationException exception is thrown with the message obtained from the XtraRichEditStringId.Msg_DuplicateBookmark resource string that reads “Bookmark with that name already exists in the document”. Use the ConflictNameResolution property to process bookmarks with duplicate names.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BookmarkOptions class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also