public class PdfBookmarkEntry
extends java.lang.Object
Example
Workbook workbook = new Workbook();
workbook.getWorksheets().add();
workbook.getWorksheets().add();
Cell cellInPage1 = workbook.getWorksheets().get(0).getCells().get("A1");
Cell cellInPage2 = workbook.getWorksheets().get(1).getCells().get("A1");
Cell cellInPage3 = workbook.getWorksheets().get(2).getCells().get("A1");
cellInPage1.putValue("page1");
cellInPage2.putValue("page2");
cellInPage3.putValue("page3");
PdfBookmarkEntry pbeRoot = new PdfBookmarkEntry();
pbeRoot.setText("root"); // if pbeRoot.Text = null, all children of pbeRoot will be inserted on the top level in the bookmark.
pbeRoot.setDestination(cellInPage1);
pbeRoot.setSubEntry(new ArrayList());
pbeRoot.setOpen(false);
PdfBookmarkEntry subPbe1 = new PdfBookmarkEntry();
subPbe1.setText("section1");
subPbe1.setDestination(cellInPage2);
PdfBookmarkEntry subPbe2 = new PdfBookmarkEntry();
subPbe2.setText("section2");
subPbe2.setDestination(cellInPage3);
pbeRoot.getSubEntry().add(subPbe1);
pbeRoot.getSubEntry().add(subPbe2);
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setBookmark(pbeRoot);
workbook.save("output_bookmark.pdf", saveOptions);
| Constructor and Description |
|---|
PdfBookmarkEntry() |
| Modifier and Type | Method and Description |
|---|---|
Cell |
getDestination()
The cell to which the bookmark link.
|
java.lang.String |
getDestinationName()
Gets name of destination.
|
java.util.ArrayList |
getSubEntry()
SubEntry of a bookmark.
|
java.lang.String |
getText()
Title of a bookmark.
|
boolean |
isCollapse()
When this property is true, the bookmarkentry will collapse, otherwise it will expand.
|
boolean |
isOpen()
When this property is true, the bookmarkentry will expand, otherwise it will collapse.
|
void |
setCollapse(boolean value)
When this property is true, the bookmarkentry will collapse, otherwise it will expand.
|
void |
setDestination(Cell value)
The cell to which the bookmark link.
|
void |
setDestinationName(java.lang.String value)
Sets name of destination.
|
void |
setOpen(boolean value)
When this property is true, the bookmarkentry will expand, otherwise it will collapse.
|
void |
setSubEntry(java.util.ArrayList value)
SubEntry of a bookmark.
|
void |
setText(java.lang.String value)
Title of a bookmark.
|
public java.lang.String getText()
public void setText(java.lang.String value)
public Cell getDestination()
public void setDestination(Cell value)
public java.lang.String getDestinationName()
Remarks
If destination name is set, the destination will be defined as a named destination with this name.public void setDestinationName(java.lang.String value)
Remarks
If destination name is set, the destination will be defined as a named destination with this name.public java.util.ArrayList getSubEntry()
public void setSubEntry(java.util.ArrayList value)
public boolean isOpen()
public void setOpen(boolean value)
public boolean isCollapse()
public void setCollapse(boolean value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.