PdfBookmarkEntry

Inheritance: java.lang.Object

public class PdfBookmarkEntry

PdfBookmarkEntry is an entry in pdf bookmark. if Text property of current instance is null or “”, current instance will be hidden and children will be inserted on current level.

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);

Constructors

ConstructorDescription
PdfBookmarkEntry()

Methods

MethodDescription
equals(Object arg0)
getClass()
getDestination()The cell to which the bookmark link.
getDestinationName()Gets name of destination.
getSubEntry()SubEntry of a bookmark.
getText()Title of a bookmark.
hashCode()
isCollapse()When this property is true, the bookmarkentry will collapse, otherwise it will expand.
isOpen()When this property is true, the bookmarkentry will expand, otherwise it will collapse.
notify()
notifyAll()
setCollapse(boolean value)When this property is true, the bookmarkentry will collapse, otherwise it will expand.
setDestination(Cell value)The cell to which the bookmark link.
setDestinationName(String value)Sets name of destination.
setOpen(boolean value)When this property is true, the bookmarkentry will expand, otherwise it will collapse.
setSubEntry(ArrayList value)SubEntry of a bookmark.
setText(String value)Title of a bookmark.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PdfBookmarkEntry()

public PdfBookmarkEntry()

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDestination()

public Cell getDestination()

The cell to which the bookmark link.

Returns: Cell

getDestinationName()

public String getDestinationName()

Gets name of destination.

Remarks

If destination name is set, the destination will be defined as a named destination with this name.

Returns: java.lang.String

getSubEntry()

public ArrayList getSubEntry()

SubEntry of a bookmark.

Returns: java.util.ArrayList

getText()

public String getText()

Title of a bookmark.

Returns: java.lang.String

hashCode()

public native int hashCode()

Returns: int

isCollapse()

public boolean isCollapse()

When this property is true, the bookmarkentry will collapse, otherwise it will expand.

Returns: boolean

isOpen()

public boolean isOpen()

When this property is true, the bookmarkentry will expand, otherwise it will collapse.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setCollapse(boolean value)

public void setCollapse(boolean value)

When this property is true, the bookmarkentry will collapse, otherwise it will expand.

Parameters:

ParameterTypeDescription
valueboolean

setDestination(Cell value)

public void setDestination(Cell value)

The cell to which the bookmark link.

Parameters:

ParameterTypeDescription
valueCell

setDestinationName(String value)

public void setDestinationName(String value)

Sets name of destination.

Remarks

If destination name is set, the destination will be defined as a named destination with this name.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setOpen(boolean value)

public void setOpen(boolean value)

When this property is true, the bookmarkentry will expand, otherwise it will collapse.

Parameters:

ParameterTypeDescription
valueboolean

setSubEntry(ArrayList value)

public void setSubEntry(ArrayList value)

SubEntry of a bookmark.

Parameters:

ParameterTypeDescription
valuejava.util.ArrayList

setText(String value)

public void setText(String value)

Title of a bookmark.

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int