Class: Bookmark

Core. Bookmark

Represents a bookmark in a Document.

new Bookmark(children, name, pageNumber, parent, verticalOffset, horizontalOffset [, url] [, index] [, objNum] [, xfdfActions] [, color])

Bookmarks typically represent an outline of the document, and as each bookmark is usually associated with a specific page in a document, they are typically used to facilitate navigation.
Parameters:
Name Type Argument Description
children Array.<Core.Bookmark> A list of child bookmarks
name string The name of the bookmark
pageNumber number The page number of the bookmark
parent Core.Bookmark The parent bookmark of this bookmark
verticalOffset number The vertical position that the linked page will be scrolled to
horizontalOffset number The horizontal position that the linked page will be scrolled to
url string <optional>
An optional parameter that allows the bookmark to link to a URL instead of a page number (this overrides the page number)
index number <optional>
An optional parameter that indicates the position of the bookmark among its siblings
objNum number <optional>
The PDF object number of the bookmark
xfdfActions string <optional>
The XFDF of the actions associated with the bookmark
color Array.<number> <optional>
The color of the bookmark

Methods


getAction()

Gets the Action for the bookmark
Returns:
The action for the bookmark
Type
Core.Actions.JavaScript

getChildren()

Gets the children of the bookmark.
Returns:
The children of the bookmark
Type
Array.<Core.Bookmark>

getColor()

Gets the color of the bookmark
Returns:
An object with RGB values (r, g, b)
Type
object

getHorizontalPosition()

Gets the horizontal position of the bookmark.
Returns:
The horizontal position of the bookmark
Type
number

getIndex()

Gets the index of the bookmark among its siblings
Returns:
The index of the bookmark
Type
number

getName()

Gets the name of the bookmark.
Returns:
The name of the bookmark
Type
string

getObjNum()

Gets the PDF object number of the bookmark.
Returns:
The PDF object number of the bookmark
Type
number

getPageNumber()

Gets the page number of the bookmark.
Returns:
The page number of the bookmark
Type
number

getParent()

Gets the parent of this bookmark if it has one.
Returns:
The parent of the bookmark
Type
Core.Bookmark

getURL()

Gets the url of the bookmark if it has one.
Returns:
The url of the bookmark
Type
string

getVerticalPosition()

Gets the vertical position of the bookmark.
Returns:
The vertical position of the bookmark
Type
number

isValid()

Determines whether the bookmark goes to a valid destination.
Returns:
Whether the bookmark points to a valid destination
Type
boolean

setAction(action)

Sets an Action for the bookmark Currently only JavaScript actions are supported
Parameters:
Name Type Description
action Core.Actions.JavaScript The action that will be triggered when the bookmark is clicked