| java.lang.Object | |
| ↳ | com.pdftron.pdf.Bookmark |
A %PDF document may optionally display a document outline on the screen, allowing the user to navigate interactively from one part of the document to another. The outline consists of a tree-structured hierarchy of Bookmarks (sometimes called outline items), which serve as a 'visual table of contents' to display the document's structure to the user. Each Bookmark has a title that appears on screen, and an Action that specifies what happens when a user clicks on the Bookmark. The typical action for a user-created Bookmark is to move to another location in the current document, although any action (see PDF::Action) can be specified. Bookmark is a utility class used to simplify work with %PDF bookmarks (or outlines; see section 8.2.2 'Document Outline' in %PDF Reference Manual for more details).
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Bookmark()
A constructor.
| |||||||||||
|
Bookmark(Obj in_bookmark_dict)
A constructor.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addChild(Bookmark in_bookmark)
Adds the specified Bookmark as the new last child of this Bookmark.
| ||||||||||
| Bookmark |
addChild(String in_title)
Adds a new Bookmark as the new last child of this Bookmark.
| ||||||||||
| Bookmark |
addNext(String in_title)
Adds a new Bookmark to the tree containing this Bookmark, as the
new right sibling.
| ||||||||||
| void |
addNext(Bookmark in_bookmark)
Adds the specified Bookmark as the new right sibling to this Bookmark,
adjusting the tree containing this Bookmark appropriately.
| ||||||||||
| Bookmark |
addPrev(String in_title)
Adds a new Bookmark to the tree containing this Bookmark, as the
new left sibling.
| ||||||||||
| void |
addPrev(Bookmark in_bookmark)
Adds the specified Bookmark as the new left sibling to this Bookmark,
adjusting the tree containing this Bookmark appropriately.
| ||||||||||
| static Bookmark |
create(PDFDoc in_doc, String in_title)
Creates a new valid Bookmark with given title in the
specified document.
| ||||||||||
| void |
delete()
Removes the Bookmark's subtree from the bookmark tree containing it.
| ||||||||||
| boolean |
equals(Object b)
Compares two Bookmark objects for equality.
| ||||||||||
| Bookmark |
find(String in_title)
Get the Bookmark specified by the given title string.
| ||||||||||
| Action |
getAction()
Get the Bookmark's action.
| ||||||||||
| double[] |
getColor()
Get the Bookmark's RGB color value.
| ||||||||||
| Bookmark |
getFirstChild()
Returns the Bookmark's first child.
| ||||||||||
| int |
getFlags()
Get the Bookmark's flags.
| ||||||||||
| int |
getIndent()
Get the indentation level of the Bookmark in its containing tree.
| ||||||||||
| Bookmark |
getLastChild()
Returns the Bookmark's last child.
| ||||||||||
| Bookmark |
getNext()
Returns the Bookmark's next (right) sibling.
| ||||||||||
| int |
getOpenCount()
Get the number of opened bookmarks in this subtree.
| ||||||||||
| Bookmark |
getParent()
Returns the Bookmark's parent Bookmark.
| ||||||||||
| Bookmark |
getPrev()
Returns the Bookmark's previous (left) sibling.
| ||||||||||
| Obj |
getSDFObj()
Returns the underlying SDF/Cos object.
| ||||||||||
| String |
getTitle()
Get the Bookmark's title string.
| ||||||||||
| Obj |
getTitleObj()
Get the Bookmark's title string object.
| ||||||||||
| boolean |
hasChildren()
Indicates whether the Bookmark has children.
| ||||||||||
| int | hashCode() | ||||||||||
| boolean |
isOpen()
Indicates whether the Bookmark is open.
| ||||||||||
| boolean |
isValid()
Indicates whether the Bookmark is valid (non-null).
| ||||||||||
| void |
removeAction()
Removes the Bookmark's action.
| ||||||||||
| void |
setAction(Action in_action)
Set the Bookmark's action.
| ||||||||||
| void |
setColor(double in_r, double in_g, double in_b)
Set Bookmark's text to specified color in RGB value
| ||||||||||
| void |
setColor()
Set Bookmark's text to black.
| ||||||||||
| void |
setFlags(int in_flags)
Set the Bookmark's flags.
| ||||||||||
| void |
setOpen(boolean in_open)
Open or close the Bookmark.
| ||||||||||
| void |
setTitle(String title)
Set the Bookmark's title string.
| ||||||||||
| void |
unlink()
Unlinks this Bookmark from the bookmark tree that contains it, and
adjusts the tree appropriately.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
A constructor. Creates a null (non-valid) bookmark.
A constructor. Creates a Bookmark and initialize it using given Cos/SDF object.
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
| in_bookmark_dict | Pointer to the Cos/SDF object (outline item dictionary). |
|---|
Adds the specified Bookmark as the new last child of this Bookmark.
Note: Parameter in_bookmark must not be linked to a bookmark tree.
Note: If this Bookmark previously had no children, it will be open after the child is added.
| in_bookmark | The Bookmark object to be added as a last child of this Bookmark. |
|---|
| PDFNetException |
|---|
Adds a new Bookmark as the new last child of this Bookmark.
Note: If this Bookmark previously had no children, it will be open after the child is added.
| in_title | The title string value of the new Bookmark. |
|---|
| PDFNetException |
|---|
Adds a new Bookmark to the tree containing this Bookmark, as the new right sibling.
| in_title | The title string value of the new Bookmark. |
|---|
| PDFNetException |
|---|
Adds the specified Bookmark as the new right sibling to this Bookmark, adjusting the tree containing this Bookmark appropriately.
Note: Parameter in_bookmark must not be linked to a bookmark tree.
| in_bookmark | The Bookmark object to be added to this Bookmark. |
|---|
| PDFNetException |
|---|
Adds a new Bookmark to the tree containing this Bookmark, as the new left sibling.
| in_title | The title string value of the new Bookmark. |
|---|
| PDFNetException |
|---|
Adds the specified Bookmark as the new left sibling to this Bookmark, adjusting the tree containing this Bookmark appropriately.
Note: Parameter in_bookmark must not be linked to a bookmark tree.
| in_bookmark | The Bookmark object to be added to this Bookmark. |
|---|
| PDFNetException |
|---|
Creates a new valid Bookmark with given title in the specified document.
Note: The new Bookmark is not linked to the outline tree. Use AddChild()/AddNext()/AddPrev() methods in order to link the Bookmark to the outline tree
| in_doc | The document in which a Bookmark is to be created. |
|---|---|
| in_title | The title string value of the new Bookmark. |
| PDFNetException |
|---|
Removes the Bookmark's subtree from the bookmark tree containing it.
| PDFNetException |
|---|
Compares two Bookmark objects for equality.
| b | the b |
|---|
Get the Bookmark specified by the given title string.
| in_title | The title string value of the Bookmark to find. |
|---|
| PDFNetException |
|---|
Get the Bookmark's RGB color value.
Note: The three numbers out_r, out_g, and out_b are in the range 0.0 to 1.0,
representing the components in the DeviceRGB color space of the color
to be used for the Bookmark's text.
double red, green, blue;
bookmark.GetColor(red, green, blue);
| PDFNetException |
|---|
Get the Bookmark's flags.
| PDFNetException |
|---|
Get the indentation level of the Bookmark in its containing tree.
Note: The root level has an indentation level of zero.
| PDFNetException |
|---|
Returns the Bookmark's next (right) sibling.
| PDFNetException |
|---|
Get the number of opened bookmarks in this subtree.
| PDFNetException |
|---|
Returns the Bookmark's parent Bookmark.
| PDFNetException |
|---|
Returns the Bookmark's previous (left) sibling.
| PDFNetException |
|---|
Returns the underlying SDF/Cos object.
Note: A null (non-valid) bookmark returns a null object.
Get the Bookmark's title string object.
| PDFNetException |
|---|
Indicates whether the Bookmark has children.
| PDFNetException |
|---|
Indicates whether the Bookmark is open.
Note: An open Bookmark shows all its children.
| PDFNetException |
|---|
Indicates whether the Bookmark is valid (non-null).
Note: If this method returns false the underlying SDF/Cos object is null and the Bookmark object should be treated as null as well.
| PDFNetException |
|---|
Set the Bookmark's action.
| in_action | The new Action for the Bookmark. |
|---|
| PDFNetException |
|---|
Set Bookmark's text to specified color in RGB value
| in_r | the red component in the DeviceRGB color space |
|---|---|
| in_g | the green component in the DeviceRGB color space |
| in_b | the blue component in the DeviceRGB color space |
| PDFNetException |
|---|
Set the Bookmark's flags.
| in_flags | The new bookmark flags. Bit 1 (the least-significant bit) indicates italic font whereas bit 2 indicates bold font. Therefore, 0 indicates normal, 1 is italic, 2 is bold, and 3 is bold-italic. |
|---|
| PDFNetException |
|---|
Open or close the Bookmark.
Note: An opened Bookmark shows its children, while a closed Bookmark does not.
| in_open | Boolean value that contains the status. If true, the Bookmark is opened. Otherwise the Bookmark is closed. |
|---|
| PDFNetException |
|---|
Set the Bookmark's title string.
| title | The new title string for the bookmark. |
|---|
| PDFNetException |
|---|
Unlinks this Bookmark from the bookmark tree that contains it, and adjusts the tree appropriately.
Note: After the bookmark is unlinked is can be moved to another place in the bookmark tree located in the same document.
| PDFNetException |
|---|