FoxitPDFSDKforWeb  v10.0.0
Foxit PDF SDK for Web
BookmarkUIService Class Reference

Bookmark service for manipulating bookmark data at the UIExtension level. Different from BookmarkDataService, the BookmarkUIService also updates the UI and supports undo-redo. More...

Public Member Functions

Promise< number > addBookmark (options)
 Creates a new bookmark node and inserts it into the bookmark tree component. This operation can be undone if the undo-redo addon is loaded in PDFUI. More...
 
void cutBookmark (bookmarkId)
 Marks a bookmark node as cut and adds the fv__ui-bookmark-tree-cut-node class to its DOM node. More...
 
Promise< void > deleteBookmark (bookmarkId)
 Delete the bookmark data node and delete the corresponding tree node. This operation can be undone if the undo-redo addon is loaded in PDFUI. More...
 
number undefined getCurrentActiveBookmarkId ()
 Retrieves the ID of the currently active bookmark. More...
 
void onSwitchCurrentBookmarkNode (callback)
 This event is triggered when a user manually selects a bookmark or when the document navigates to a bookmark due to page turning.. More...
 
Promise< void > pasteCutBookmark (destBookmarkId, destParentBookmarkId, relationship)
 Move the cut bookmark node to the specified position according to the relationship. If there are no bookmarks to be cut, this method does nothing. More...
 
Promise< void > renameBookmark (bookmarkId, newTitle)
 Renames a bookmark node. This operation can be undone if the undo-redo addon is loaded in PDFUI. More...
 
Promise< void > setColor (bookmarkId, newColor)
 Updates the text color of a bookmark node. More...
 
Promise< void > setDestination (bookmarkId, newDestination)
 Updates the destination of a bookmark node. More...
 
Promise< void > setFontStyle (bookmarkId, newFontStyle)
 Updates the font style of a bookmark node. More...
 

Detailed Description

Bookmark service for manipulating bookmark data at the UIExtension level. Different from BookmarkDataService, the BookmarkUIService also updates the UI and supports undo-redo.

See also
BookmarkDataService
PDFUI.getBookmarkUIService
Since
10.0.0

Member Function Documentation

◆ addBookmark()

Promise<number> BookmarkUIService::addBookmark ( options  )

Creates a new bookmark node and inserts it into the bookmark tree component. This operation can be undone if the undo-redo addon is loaded in PDFUI.

Parameters
optionsAddBookmarkOptions - Options for creating the new bookmark.
Returns
Promise<number> - A promise that resolves with the new bookmark ID or rejects if failed.
Since
10.0.0

◆ cutBookmark()

void BookmarkUIService::cutBookmark ( bookmarkId  )

Marks a bookmark node as cut and adds the fv__ui-bookmark-tree-cut-node class to its DOM node.

Parameters
bookmarkIdnumber - The bookmark ID.
Returns
void -
See also
BookmarkDataService.cutBookmark
BookmarkDataService.pasteCutBookmark
Since
10.0.0

◆ deleteBookmark()

Promise<void> BookmarkUIService::deleteBookmark ( bookmarkId  )

Delete the bookmark data node and delete the corresponding tree node. This operation can be undone if the undo-redo addon is loaded in PDFUI.

Parameters
bookmarkIdnumber - The bookmark ID to delete.
Returns
Promise<void> - A promise that resolves when the deletion is successful or rejects if failed.
Since
10.0.0

◆ getCurrentActiveBookmarkId()

number undefined BookmarkUIService::getCurrentActiveBookmarkId ( )

Retrieves the ID of the currently active bookmark.

Returns
number|undefined - The current active bookmark ID.
Since
10.0.0

◆ onSwitchCurrentBookmarkNode()

void BookmarkUIService::onSwitchCurrentBookmarkNode ( callback  )

This event is triggered when a user manually selects a bookmark or when the document navigates to a bookmark due to page turning..

Parameters
callback(last:BookmarkData,current:BookmarkData)=>void -
Returns
void -
Since
10.0.0

◆ pasteCutBookmark()

Promise<void> BookmarkUIService::pasteCutBookmark ( destBookmarkId  ,
destParentBookmarkId  ,
relationship   
)

Move the cut bookmark node to the specified position according to the relationship. If there are no bookmarks to be cut, this method does nothing.

Parameters
destBookmarkIdnumber - The destination bookmark node id.
destParentBookmarkIdnumber|undefined - The parent id of the destination bookmark node.
relationshipBookmarkRelationship - The relationship between source and destination.
Returns
Promise<void> -
Since
10.0.0

◆ renameBookmark()

Promise<void> BookmarkUIService::renameBookmark ( bookmarkId  ,
newTitle   
)

Renames a bookmark node. This operation can be undone if the undo-redo addon is loaded in PDFUI.

Parameters
bookmarkIdnumber - The bookmark ID.
newTitlestring - The new title for the bookmark.
Returns
Promise<void> - A promise that resolves when the renaming is successful or rejects if failed.
Since
10.0.0

◆ setColor()

Promise<void> BookmarkUIService::setColor ( bookmarkId  ,
newColor   
)

Updates the text color of a bookmark node.

Parameters
bookmarkIdnumber - The bookmark ID
newColorstring - The new color for the bookmark.
Returns
Promise<void> - A promise that resolves when the setting is successful or rejects if failed.
Since
10.0.0

◆ setDestination()

Promise<void> BookmarkUIService::setDestination ( bookmarkId  ,
newDestination   
)

Updates the destination of a bookmark node.

Parameters
bookmarkIdnumber - The bookmark ID
newDestinationBookmarkDestination - The new destination infomation for the bookmark
Returns
Promise<void> - A promise that resolves when the setting is successful or rejects if failed.
Since
10.0.0

◆ setFontStyle()

Promise<void> BookmarkUIService::setFontStyle ( bookmarkId  ,
newFontStyle   
)

Updates the font style of a bookmark node.

Parameters
bookmarkIdnumber - The bookmark ID.
newFontStyeBookmarkFontStyle - The new font style for the bookmark.
Returns
Promise<void> - A promise that resolves when the setting is successful or rejects if failed.

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.