Programatically jump to Bookmark or any position in the document

Hi, is it possible to jump with the cursor to a specific area in the document ?

A method like "jumo_to_bookmark('mybookmark') or anything alike ?

I need to set the cursor to specific positions programmatically and dont want to let the user do that with the bookmarks dialog. I want to set a few bookmark objects in the sfdt-JSON and have a method to jump to these bookma

rks.

Thanks. 


1 Reply

AE Ajithamarlin Edward Syncfusion Team February 10, 2022 01:07 PM UTC

Hi Thomas,


#Regarding A method like "jumo_to_bookmark('mybookmark') or anything alike ?


You can jump to the bookmark using the SelectBookmark API in the selection module


Sample Code snippet


this.container.documentEditor.selection.selectBookmark(#bookmarkname)


In bookmark name you have to pass the name of particular bookmark as parameter.


To know further about the SelectBookmark API, Please refer the below documentation


https://ej2.syncfusion.com/angular/documentation/api/document-editor/selection/#selectbookmark


Please let us know if you need any further assistance.


Regards,

Ajithamarlin E


Loader.
Up arrow icon