Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfViewerControl.Bookmarks Property

Returns a list of document bookmarks.

Namespace: DevExpress.Xpf.PdfViewer

Assembly: DevExpress.Xpf.PdfViewer.v24.2.dll

NuGet Package: DevExpress.Wpf.PdfViewer

#Declaration

public IReadOnlyList<PdfViewerBookmark> Bookmarks { get; }

#Property Value

Type Description
IReadOnlyList<PdfViewerBookmark>

A list of document bookmarks.

#Remarks

Call the GoToBookmark method to navigate to a specific bookmark.

The code sample below navigates to a bookmark node with a specific title when the document is loaded. Call the Dispatcher.BeginInvoke method to use the GoToBookmark method in the PdfViewerControl.DocumentLoaded event handler.

private void PdfViewer_DocumentLoaded(object sender, RoutedEventArgs e) {
    foreach (var bookmarkItem in pdfViewer.Bookmarks) {
        if (bookmarkItem.Title == "Annotations")
            Dispatcher.BeginInvoke(new Action(() => pdfViewer.GoToBookmark(bookmarkItem)), DispatcherPriority.ApplicationIdle);
    }
}

The PdfViewerBookmarkExtensions.FindBookmark method allows you to find a bookmark that meets the specified criteria. This method can be useful if you need to find a bookmark in a document with a complex bookmark tree.

The code sample below finds a bookmark with the specified title and navigates to this bookmark when the document is loaded:

using DevExpress.Pdf;

private void PdfViewer_DocumentLoaded(object sender, RoutedEventArgs e) {
    var bookmark = pdfViewer.Bookmarks.FindBookmark(x => x.Title == "4 Notation");
    if (bookmark != null) {
        pdfViewer.GoToBookmark(bookmark);
    }

}
See Also