Bookmark Navigation in Windows Forms PDF Viewer (PdfViewerControl)
29 Sep 2020 / 2 minutes to read
PDF Viewer control allows users to navigate to the bookmarks present in the loaded PDF document at the UI level.
Steps to perform bookmark navigation in PdfViewerControl.
- Open the bookmarks contained PDF document to enable the bookmark button in
PdfViewerControl
. - Clicking on the bookmark button from the left pane will list the bookmarks present in the PDF document.
- To jump to a specific section, click its name in the bookmark pane.
- If the bookmark has some children, you can explore them by clicking on the “+” button to the left of it.
Programmatically navigate to a bookmark destination
You can navigate to the desired bookmark destination using the GotoBookmark(PdfBookmark)
method in PdfDocumentView
. The target/destination bookmark should be provided as the parameter to this method. Refer to the following code sample.
//Loads the PDF document in PdfLoadedDocument
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream);
//Retrieves the bookmark collection from the loaded PDF document
PdfBookmarkBase bookmark = loadedDocument.Bookmarks;
//Navigate to the specified bookmark destination offset
pdfDocumentView.GoToBookmark(bookmark[0]);
Loads the PDF document in PdfLoadedDocument
Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(documentStream)
`Retrieves the bookmark collection from the loaded PDF document
Dim bookmark As PdfBookmarkBase = loadedDocument.Bookmarks
`Navigate to the specified bookmark destination offset
pdfDocumentView.GoToBookmark(bookmark(0))
Enabling and disabling bookmark feature
You can enable and disable the bookmark button from the built-in toolbar using the IsBookmarkEnabled
property available in PdfViewerControl
.
Property | Action |
---|---|
Enables or disables the bookmark feature. |
This property removes the bookmark button and disables the bookmark feature when it is set to false and vice versa.
//Bookmark feature is disabled
pdfViewerControl.IsBookmarkEnabled = false;
'Bookmark feature is disabled
pdfViewerControl.IsBookmarkEnabled = false
The following screenshot shown the Bookmark navigation in PdfViewerControl
,
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page