Having trouble getting help?
Contact Support
Contact Support
Open and Close Bookmark pane programmatically
3 May 20241 minute to read
The PDF Viewer library allows you to open the Bookmark pane programmatically using the openBookmarkPane() method.
The following steps are used to open the Bookmark.
Step 1: Follow the steps provided in the link to create a simple PDF Viewer sample.
Step 2: Insert the following code snippet to implement the functionality for opening the Bookmark pane:
<button (click)="openBookmark()">Open Thumbnail Pane</button>
openBookmark() {
var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
// Open Bookmark pane.
viewer.bookmarkViewModule.openBookmarkPane();
}
Similarly, to close the Bookmark pane programmatically, employ the following code snippet:
<button (click)="closeBookmark()">Close Bookmark Pane</button>
closeBookmark() {
var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
// Close Bookmark pane.
viewer.bookmarkViewModule.closeBookmarkPane();
}