FoxitPDFSDKforWeb  v9.2.1
Foxit PDF SDK for Web
PDFBookmark Class Reference

Public Member Functions

 insertBookmark (title, pageIndex, top, left, relationship=1)
 Insert a new bookmark to current bookmark. Will trigger Event DataEvents.bookmarkAdded. More...
 
 remove ()
 Remove a specified bookmark. Will trigger Event PDFViewCtrl.constants.ViewerEvents.bookmarkRemoved. More...
 
 setProperty (properties)
 Set specity bookmark properties. More...
 

Public Attributes

PDFBookmark [] children
 An array containing all subbookmarks.
 
string color
 The color of the bookmark text. text: #FFFFFF.
 
number id
 An unique identity of bookmark.
 
number isBold
 Whether to display bookmark text in bold font. 1 is bold, 0 is normal.
 
number isItalic
 Whether to display bookmark text in italic font. 1 is italic, 0 is normal.
 
number left
 The x coordinate of the page position to jump to after clicking.
 
number page
 The index of the page to jump to after clicking.
 
number title
 The text content of the bookmark.
 
number top
 The y coordinate of the page position to jump to after clicking.
 

Detailed Description

PDFBookmark object

Member Function Documentation

◆ insertBookmark()

PDFBookmark::insertBookmark (   title,
  pageIndex,
  top,
  left,
  relationship = 1 
)
inline

Insert a new bookmark to current bookmark. Will trigger Event DataEvents.bookmarkAdded.

Parameters
titlestring - Title string for the new bookmark.
pageIndexnumber - The index of the destination page in the PDF document.
topnumber - Horizontal coordinate value of a position as page's left-top position.
leftnumber - Vertical coordinate value of a position as page's left-top position.
[relationship=Relationship.lastChild]Relationship - The relationship between new bookmark and current bookmark. Default value is Relationship.lastChild. Please Refer to Relationship.
Returns
Promise<PDFBookmark|null> - New bookmark to JSON.

◆ remove()

PDFBookmark::remove ( )
inline

Remove a specified bookmark. Will trigger Event PDFViewCtrl.constants.ViewerEvents.bookmarkRemoved.

Returns
Promise<boolean> - true means success, and false means failure.

◆ setProperty()

PDFBookmark::setProperty (   properties)
inline

Set specity bookmark properties.

Parameters
properties{title:string,color:number|[string,number,number,number]|string,style:number} - Will trigger Event PDFViewCtrl.constants.ViewerEvents.bookmarkUpdated. Supported color format:
  • number, such as 0xff0000, 16711680
  • PDF color array, such as ['RGB',1,1,1] which means white. Range: 0.0~1.0, The ratio to HTML color format is 1:255.
  • HTML color format, such as '#ff0000', 'rgb(255,0,0)', 'rgba(255,0,0,1)'. Style can be one of Font_Style, or a combination of it.
Returns
Promise<PDFBookmark> - Modified bookmark to JSON.

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