Bookmark Class
A PDF bookmark.
Declaration
public class Bookmark extends JavaObject
Remarks
Refer to the following help topic for additional information: Create and Manage PDF Bookmarks.
The following code snippet creates nested bookmarks. The document outline displays a collapsible bookmark tree.
Bookmark chapters = new Bookmark("Chapters");
// Create child bookmarks.
Bookmark chapter1 = new Bookmark("Chapter 1");
chapter1.setPage(document.getPages().get(1));
chapter1.setDestination(new FitDestination());
Bookmark chapter2 = new Bookmark("Chapter 2");
chapter2.setPage(document.getPages().get(2));
chapter2.setDestination(new FitDestination());
// Add child bookmarks.
chapters.getChildren().add(chapter1);
chapters.getChildren().add(chapter2);
document.getBookmarks().add(chapters);
Inherited Members
Inheritance
Constructors
Bookmark() Constructor
Initializes a new instance of the Bookmark class.
Declaration
public Bookmark()
Bookmark(String title) Constructor
Initializes a new bookmark with the specified title.
Declaration
public Bookmark(String title)
Parameters
| Name | Type | Description |
|---|---|---|
| title | String | The bookmark title. |
Methods
getAction() Method
Returns the bookmark action.
Declaration
public InteractiveAction getAction()
Returns
| Type | Description |
|---|---|
| InteractiveAction | The bookmark action. |
getBold() Method
Returns whether the bookmark title uses bold text.
Declaration
public boolean getBold()
Returns
| Type | Description |
|---|---|
| boolean |
|
getChildren() Method
Returns child bookmarks.
Declaration
public IBookmarkCollection getChildren()
Returns
| Type | Description |
|---|---|
| IBookmarkCollection | Child bookmarks. |
getDestination() Method
Returns the bookmark destination.
Declaration
public Destination getDestination()
Returns
| Type | Description |
|---|---|
| Destination | The bookmark destination. |
getInitiallyClosed() Method
Returns whether the bookmark is initially closed.
Declaration
public boolean getInitiallyClosed()
Returns
| Type | Description |
|---|---|
| boolean |
|
getItalic() Method
Returns whether the bookmark title uses italic text.
Declaration
public boolean getItalic()
Returns
| Type | Description |
|---|---|
| boolean |
|
getPage() Method
Returns the bookmark page.
Declaration
public Page getPage()
Returns
| Type | Description |
|---|---|
| Page | The bookmark page. |
getTextColor() Method
Returns the bookmark text color.
Declaration
public PdfColor getTextColor()
Returns
| Type | Description |
|---|---|
| PdfColor | The bookmark text color. |
getTitle() Method
Returns the bookmark title.
Declaration
public String getTitle()
Returns
| Type | Description |
|---|---|
| String | The bookmark title. |
setAction(InteractiveAction value) Method
Sets the bookmark action.
Declaration
public void setAction(InteractiveAction value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | InteractiveAction | The bookmark action. |
setBold(boolean value) Method
Sets whether the bookmark title uses bold text.
Declaration
public void setBold(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setDestination(Destination value) Method
Sets the bookmark destination.
Declaration
public void setDestination(Destination value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Destination | The bookmark destination. |
setInitiallyClosed(boolean value) Method
Sets whether the bookmark is initially closed.
Declaration
public void setInitiallyClosed(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setItalic(boolean value) Method
Sets whether the bookmark title uses italic text.
Declaration
public void setItalic(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setPage(Page value) Method
Sets the bookmark page.
Declaration
public void setPage(Page value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Page | The bookmark page. |
setTextColor(PdfColor value) Method
Sets the bookmark text color.
Declaration
public void setTextColor(PdfColor value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | PdfColor | The bookmark text color. |
setTitle(String value) Method
Sets the bookmark title.
Declaration
public void setTitle(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The bookmark title. |