Class: Bookmark

Core. Bookmark

Represents a bookmark in a Document.

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

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

Methods


getChildren()

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

getHorizontalPosition()

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

getHPos()

Gets the horizontal position of the bookmark.
Deprecated:
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

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

getVPos()

Gets the vertical position of the bookmark.
Deprecated:
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