Back to Devexpress

BookmarkOptions Class

officefileapi-devexpress-dot-xtrarichedit-6a74bd0f.md

latest5.4 KB
Original Source

BookmarkOptions Class

Contains settings used to define the bookmark appearance and behavior in the Rich Text Editor.

Namespace : DevExpress.XtraRichEdit

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[ComVisible(true)]
public class BookmarkOptions :
    RichEditNotificationOptions
vb
<ComVisible(True)>
Public Class BookmarkOptions
    Inherits RichEditNotificationOptions

The following members return BookmarkOptions objects:

Remarks

Visualize the Bookmark (Rich Text Editor for WinForms)

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:

csharp
using DevExpress.XtraRichEdit;
using System.Drawing;
//...

BookmarkOptions bookmarkOptions = richEditControl.Options.Bookmarks;
bookmarkOptions.Visibility = RichEditBookmarkVisibility.Visible;
bookmarkOptions.Color = Color.Sienna;
vb
Imports DevExpress.XtraRichEdit
Imports System.Drawing
'...

Dim bookmarkOptions As BookmarkOptions = richEditControl.Options.Bookmarks
bookmarkOptions.Visibility = RichEditBookmarkVisibility.Visible
bookmarkOptions.Color = Color.Sienna

Note

Bookmark visibility options do not affect documents that you export or print from the RichEditDocumentServer. You must specify these properties in the Rich Text Editor or other word processing applications to show the bookmark.

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:

csharp
using DevExpress.XtraRichEdit;

using (var wordProcessor = new RichEditDocumentServer())
{
    //...
    BookmarkOptions bookmarkOptions = wordProcessor.Options.Bookmarks;
    bookmarkOptions.DisplayBookmarksInPdfNavigationPane =
         PdfBookmarkDisplayMode.TocBookmarks;
}
vb
Imports DevExpress.XtraRichEdit

Using wordProcessor = New RichEditDocumentServer()
    '...
    Dim bookmarkOptions As BookmarkOptions = wordProcessor.Options.Bookmarks
    bookmarkOptions.DisplayBookmarksInPdfNavigationPane =
         PdfBookmarkDisplayMode.TocBookmarks
End Using

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. Use the ConflictNameResolution property to process bookmarks with duplicate names.

Implements

INotifyPropertyChanged

Inheritance

Object ViewStatePersisterCore BaseOptions RichEditNotificationOptions BookmarkOptions ASPxRichEditBookmarkSettings

See Also

BookmarkOptions Members

RichEditControlOptionsBase.Bookmarks

SubDocument.Bookmarks

DocumentCapabilitiesOptions.Bookmarks

DocumentExportCapabilities.Bookmarks

DevExpress.XtraRichEdit Namespace