Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfBookmark

java.lang.Object
  extended bycom.gnostice.pdfone.PdfNode
      extended bycom.gnostice.pdfone.PdfBookmark

public final class PdfBookmark
extends com.gnostice.pdfone.PdfNode

This class represents a bookmark in a document. A bookmark is usually associated with a destination in the document which is displayed inside the PDF viewer application window (hereinafter referred as just window) when the bookmark is selected.

The PdfBookmark class is used to create, delete, and modify bookmarks. The class has methods to:

An object of this class is returned when addBookmark method of PdfDocument class is employed. getFirstBookmark method of PdfDocument class is used to retrieve the first bookmark of an existing document.

Since:
1.0
Version:
1.0

Nested Class Summary
static class PdfBookmark.RemoteGoTo
          This class represents a destination in an external PDF file.
 
Field Summary
static int BOLD
          Constant for displaying titles of bookmarks in bold type.
static int FIT
          Constant for adjusting magnification factor (zoom) of a page just enough to fit the entire page within the width and height of the viewer window.
static int FITB
          Constant for adjusting magnification factor (zoom) of a page to tightly fit entire height and width of its bounding box inside a window.
static int FITBH
          Constant for positioning the top edge of the viewer window at a specified distance from the top edge of a page and adjusting the magnification factor (zoom) so as to tightly fit entire width of the page's bounding box inside the window.
static int FITBV
          Constant for positioning the left edge of the viewer window at a specified distance from the left edge of a page and adjusting the magnification factor (zoom) so as to tightly fit entire height of the page's bounding box inside a window.
static int FITH
          Constant for adjusting magnification factor (zoom) of a page to tightly fit its entire width inside a window.
static int FITV
          Constant for positioning the left edge of the viewer window at a specified distance from the left edge of a page and adjusting the magnification factor (zoom) so as to tightly fit its entire height inside a window.
static int ITALIC
          Constant for displaying title of bookmarks in italic style.
 
Method Summary
 void addAction(PdfAction action)
          Adds a specified document-level action.
 void addActionGoto(int pageNo)
          Adds to this bookmark a go-to action capable of changing the current view of the document to a destination page specified by pageNo.
 void addActionGoto(int pageNo, double left, double top, double zoom)
          Adds to this bookmark a go-to action capable of changing the current view of the document to a destination specified by location (left, top), page pageNo, and magnification factor zoom.
 void addActionGoto(int pageNo, double x, double y, double width, double height)
          Adds to this bookmark a go-to action capable of changing the current view of the document to a specified rectangular area on a specified page.
 void addActionGoto(int pageNo, double pos, int fit)
          Adds to this bookmark a go-to action capable of changing the current view of the document to a destination specified by pos and fit on page pageNo.
 void addActionGoto(int pageNo, int fit)
          Adds to this bookmark a go-to action capable of changing the current view of the document to display entire height and width of a destination page pageNo tightly fit inside the window.
 void addActionGoto(int pageNo, PdfRect rect)
          Adds to this bookmark a go-to action capable of changing the current view of the document to a rectangular area rect on a destination page pageNo.
 void addActionJavaScript(String javascript)
          Adds a Javascript action to this bookmark.
 void addActionLaunch(String applicationOrFileToLaunch, boolean print)
          Adds a launch action to this bookmark.
 void addActionNamed(int namedAction)
          Adds a named action to this bookmark.
 void addActionRemoteGoTo(String pdfFilePath, PdfBookmark.RemoteGoTo rGoTo, boolean newWindow)
          Adds a remote go-to action to this bookmark.
 void addActionURI(String uri)
          Adds a URI action to this bookmark.
 PdfBookmark addNext(int namedAction, String title)
          Returns a newly created bookmark (inserted immediately after this bookmark) with specified named action.
 PdfBookmark addNext(String title, int pageNo)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified page.
 PdfBookmark addNext(String title, int pageNo, double left, double top, double zoom)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by position (lefttop), page pageNo, and page magnification factor zoom.
 PdfBookmark addNext(String title, int pageNo, double x, double y, double width, double height)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified rectangular area on a specified page.
 PdfBookmark addNext(String title, int pageNo, double pos, int fit)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by pos and fit on page pageNo.
 PdfBookmark addNext(String title, int pageNo, int fit)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by pageNo and fit.
 PdfBookmark addNext(String title, int pageNo, PdfRect rect)
          Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified rectangle on specified page.
 PdfBookmark addNext(String title, String applicationOrFileToLaunch, boolean print)
          Returns a newly created bookmark (inserted immediately after this bookmark) that launches a specified application or opens/prints a specified file.
 PdfBookmark addNext(String title, String javascriptOrURI, int actionType)
          Adds a new bookmark (immediately after this bookmark) that can execute a specified JavaScript action or URI action.
 PdfBookmark addNext(String title, String pdfFilePath, int pageNo, boolean newWindow)
          Adds a new bookmark (immediately after this bookmark) that can make the viewer application open a specified page of a another PDF document.
 PdfBookmark addPrevious(int namedAction, String title)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) with specified named action.
 PdfBookmark addPrevious(String title, int pageNo)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to page specified by pageNo and inserts it immediately ahead of this bookmark.
 PdfBookmark addPrevious(String title, int pageNo, double left, double top, double zoom)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by position (left, top), page pageNo, and page magnification factor zoom.
 PdfBookmark addPrevious(String title, int pageNo, double x, double y, double width, double height)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a specified rectangular area on a specified page.
 PdfBookmark addPrevious(String title, int pageNo, double pos, int fit)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by pos and fit on page pageNo.
 PdfBookmark addPrevious(String title, int pageNo, int fit)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by pageNo and fit.
 PdfBookmark addPrevious(String title, int pageNo, PdfRect rect)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a specified rectangle on specified page.
 PdfBookmark addPrevious(String title, String applicationOrFileToLaunch, boolean print)
          Returns a newly created bookmark (inserted immediately ahead of this bookmark) that launches a specified application or opens/prints a specified file.
 PdfBookmark addPrevious(String title, String javascriptOrURI, int actionType)
          Adds a new bookmark (immediately before this bookmark) that can execute a specified JavaScript action or URI action.
 PdfBookmark addPrevious(String title, String pdfFilePath, int pageNo, boolean newWindow)
          Adds a new bookmark (immediately before this bookmark) that can make the viewer application open a specified page of a another PDF document.
 List getAllActions()
          Returns a list of all actions added to this bookmark.
 List getAllActions(int type)
          Returns a list of actions of specified type that were added to this bookmark.
 Color getColor()
          Retrieves color currently used to display this bookmark.
 PdfBookmark getFirstChild()
          Returns the first child bookmark under this bookmark.
 PdfBookmark getNext()
          Returns bookmark that is immediately after current bookmark.
 PdfBookmark getParentNode()
          Returns the bookmark to which this bookmark is a child bookmark.
 PdfBookmark getPrevious()
          Returns bookmark that is immediately ahead of current bookmark.
static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo)
          Returns a remote go-to destination with specified page number.
static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double left, double bottom, double right, double top)
          Returns a remote go-to destination with specified page number and specified position of the window of the viewer application on the page.
static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double pos, int fit)
          Returns a remote go-to destination specified by pos and fit on specified page number.
static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, int fit)
          Returns a remote go-to destination with specified page number and location of the window of the viewer application on the page.
static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, PdfRect rect)
          Returns a remote go-to destination with specified page number and rectangular area on the page.
 int getStyle()
          Retrieves font style currently used to display this bookmark.
 String getTitle()
          Retrieves text currently used to display this bookmark.
 void removeAction(int type)
          Removes action of specified type from this bookmark.
 void removeAllActions()
          Removes all actions added to this bookmark.
 void removeAllActions(int type)
          Removes all actions of specified type from this bookmark.
 void removeFirstchild()
          Deletes the first child bookmark of this bookmark.
 void removeNext()
          Removes the bookmark that is immediately after this bookmark in this bookmark's level.
 void removePrevious()
          Removes the bookmark that is immediately before this bookmark.
 void setColor(Color color)
          Specifies color to be used to display this bookmark.
 void setColorAndStyle(Color c, int s)
          Specifies font color and style to be used to display this bookmark.
 void setStyle(int style)
          Specifies font style to be used to display the bookmark.
 void setTitle(String title)
          Specifies text to be used to display this bookmark.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FITH

public static final int FITH
Constant for adjusting magnification factor (zoom) of a page to tightly fit its entire width inside a window.

See Also:
Constant Field Values

FITBH

public static final int FITBH
Constant for positioning the top edge of the viewer window at a specified distance from the top edge of a page and adjusting the magnification factor (zoom) so as to tightly fit entire width of the page's bounding box inside the window.

See Also:
Constant Field Values

FITBV

public static final int FITBV
Constant for positioning the left edge of the viewer window at a specified distance from the left edge of a page and adjusting the magnification factor (zoom) so as to tightly fit entire height of the page's bounding box inside a window.

See Also:
Constant Field Values

FITV

public static final int FITV
Constant for positioning the left edge of the viewer window at a specified distance from the left edge of a page and adjusting the magnification factor (zoom) so as to tightly fit its entire height inside a window.

See Also:
Constant Field Values

FITB

public static final int FITB
Constant for adjusting magnification factor (zoom) of a page to tightly fit entire height and width of its bounding box inside a window. If the necessary horizontal and vertical magnification factors are different, viewer applications will accommodate the bounding box in the smaller of the two dimensions and center the bounding box in the other dimension.

See Also:
Constant Field Values

FIT

public static final int FIT
Constant for adjusting magnification factor (zoom) of a page just enough to fit the entire page within the width and height of the viewer window. If the necessary horizontal and vertical magnification factors are different, the viewer applications will accommodate the page in the smaller of the two dimensions and center the page in the other dimension.

See Also:
Constant Field Values

BOLD

public static final int BOLD
Constant for displaying titles of bookmarks in bold type.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
Constant for displaying title of bookmarks in italic style.

See Also:
Constant Field Values
Method Detail

getRemoteGoToInstance

public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo)
Returns a remote go-to destination with specified page number.

Parameters:
pageNo - number of the page in the external PDF file
Returns:
a remote go-to destination

getRemoteGoToInstance

public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo,
                                                           double pos,
                                                           int fit)
                                                    throws PdfException
Returns a remote go-to destination specified by pos and fit on specified page number.

Parameters:
pageNo - number of the page in the external PDF file
pos - horizontal or vertical coordinate of top-left corner of the window on the page
fit - constant specifying how the viewer application window needs to be placed on a page
Returns:
a remote go-to destination
Throws:
PdfException - if an illegal argument is supplied.

getRemoteGoToInstance

public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo,
                                                           int fit)
                                                    throws PdfException
Returns a remote go-to destination with specified page number and location of the window of the viewer application on the page.

Parameters:
pageNo - number of the page in the external PDF file
fit - constant specifying how the viewer application window needs to be placed on a page; either FITB or FIT
Returns:
a remote go-to destination
Throws:
PdfException - if an illegal argument is supplied.

getRemoteGoToInstance

public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo,
                                                           PdfRect rect)
Returns a remote go-to destination with specified page number and rectangular area on the page.

Parameters:
pageNo - number of the page
rect - rectangular area of the destination
Returns:
a remote go-to destination

getRemoteGoToInstance

public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo,
                                                           double left,
                                                           double bottom,
                                                           double right,
                                                           double top)
Returns a remote go-to destination with specified page number and specified position of the window of the viewer application on the page.

Parameters:
pageNo - number of the page in the external PDF file
left - x-coordinate of the position of the top-left corner of the window on the page
bottom - y-coordinate of the position of the bottom-right corner of the window on the page
right - x-coordinate of the position of the bottom-right corner of the window on the page
top - y-coordinate of the position of the top-left corner of the window on the page
Returns:
a remote go-to destination

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo,
                               double left,
                               double top,
                               double zoom)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by position (left, top), page pageNo, and page magnification factor zoom.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
left - x-coordinate of the destination position
top - y-coordinate of the destination position
zoom - page magnification factor with which the destination page needs to be displayed
Returns:
a new bookmark placed immediately ahead of this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to page specified by pageNo and inserts it immediately ahead of this bookmark.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the page
Returns:
a new bookmark placed immediately ahead of this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo,
                               double pos,
                               int fit)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by pos and fit on page pageNo.

 

fit pos Page Display
FITH vertical coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire width of the page inside the window.
FITBH vertical coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire width of its bounding box inside the window.
FITBV horizontal coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire height of its bounding box inside the window.
FITV horizontal coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire height of the page inside the window.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
pos - horizontal or vertical coordinate of the bookmark's destination
fit - constant determining how page needs to be displayed inside window
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo,
                               int fit)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a destination specified by pageNo and fit.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
fit - FITB or constant specifiying that entire height and width of the page's bounding box must be tightly fit within the window
Returns:
a new bookmark placed immediately before this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo,
                               PdfRect rect)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a specified rectangle on specified page.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the page that needs to be displayed when the bookmark is selected
rect - rectangular area on the page
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               int pageNo,
                               double x,
                               double y,
                               double width,
                               double height)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that leads to a specified rectangular area on a specified page.

Parameters:
title - text that needs to be used to display bookmark
pageNo - number of the page
x - x-coordinate of the top-left corner of the rectangular area
y - y-coordinate of the top-left corner of the rectangular area
width - width of the rectangular area
height - height of the rectangular area
Returns:
a new bookmark placed immediately ahead of this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(int namedAction,
                               String title)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) with specified named action.

Parameters:
namedAction - constant specifying the named action
title - text that needs to be used to display the bookmark
Returns:
a new bookmark placed immediately ahead of this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               String javascriptOrURI,
                               int actionType)
                        throws PdfException
Adds a new bookmark (immediately before this bookmark) that can execute a specified JavaScript action or URI action.

Parameters:
title - text used to display the bookmark
javascriptOrURI - JavaScript script that needs to be compiled and executed or the URI that needs to be launched by the action
actionType - either PdfAction.JAVASCRIPT or PdfAction.URI
Returns:
a new bookmark added immediately before this bookmark
Throws:
PdfException - if an illegal argument is supplied.

addPrevious

public PdfBookmark addPrevious(String title,
                               String applicationOrFileToLaunch,
                               boolean print)
                        throws PdfException
Returns a newly created bookmark (inserted immediately ahead of this bookmark) that launches a specified application or opens/prints a specified file.

Parameters:
title - text that needs to be used to display bookmark
applicationOrFileToLaunch - pathname of the application or the file
print - whether to print the file
Returns:
a new bookmark placed immediately before this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addPrevious

public PdfBookmark addPrevious(String title,
                               String pdfFilePath,
                               int pageNo,
                               boolean newWindow)
                        throws PdfException
Adds a new bookmark (immediately before this bookmark) that can make the viewer application open a specified page of a another PDF document.

Parameters:
title - text used to display the bookmark
pdfFilePath - pathname of the PDF document that needs to be opened
pageNo - number number of the page that needs to be opened by default
newWindow - whether the other PDF document needs to be opened in a new window
Returns:
a new bookmark added immediately before this bookmark
Throws:
PdfException - if an illegal argument is supplied.

addNext

public PdfBookmark addNext(String title,
                           int pageNo,
                           double left,
                           double top,
                           double zoom)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by position (lefttop), page pageNo, and page magnification factor zoom.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
left - x-coordinate of the destination position
top - y-coordinate of the destination position
zoom - page magnification factor with which the destination page needs to be displayed
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           int pageNo)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified page.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the page
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           int pageNo,
                           double pos,
                           int fit)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by pos and fit on page pageNo.

 

fit pos Page Display
FITH vertical coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire width of the page inside the window.
FITBH vertical coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire width of its bounding box inside the window.
FITBV horizontal coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire height of its bounding box inside the window.
FITV horizontal coordinate of top-left corner of window on the page Page is zoomed to tightly fit the entire height of the page inside the window.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
pos - horizontal or vertical coordinate of the bookmark's destination
fit - constant determining how page needs to be displayed inside window
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           int pageNo,
                           int fit)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a destination specified by pageNo and fit.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the destination page
fit - FITB or constant specifiying that entire height and width of the page's bounding box must be tightly fit within the window
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0

addNext

public PdfBookmark addNext(String title,
                           int pageNo,
                           PdfRect rect)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified rectangle on specified page.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the page that needs to be displayed when the bookmark is selected
rect - rectangular area on the page
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           int pageNo,
                           double x,
                           double y,
                           double width,
                           double height)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that leads to a specified rectangular area on a specified page.

Parameters:
title - text that needs to be used to display the bookmark
pageNo - number of the page
x - x-coordinate of the top-left corner of the rectangular area
y - y-coordinate of the top-left corner of the rectangular area
width - width of the rectangular area
height - height of the rectangular area
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(int namedAction,
                           String title)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) with specified named action.

Parameters:
namedAction - constant specifying the named action
title - text that needs to be used to display the bookmark
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfAction
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           String javascriptOrURI,
                           int actionType)
                    throws PdfException
Adds a new bookmark (immediately after this bookmark) that can execute a specified JavaScript action or URI action.

Parameters:
title - text used to display the bookmark
javascriptOrURI - JavaScript script that needs to be compiled and executed or the URI that needs to be launched by the action
actionType - either PdfAction.JAVASCRIPT or PdfAction.URI
Returns:
the newly added bookmark
Throws:
PdfException - if an illegal argument is supplied.

addNext

public PdfBookmark addNext(String title,
                           String applicationOrFileToLaunch,
                           boolean print)
                    throws PdfException
Returns a newly created bookmark (inserted immediately after this bookmark) that launches a specified application or opens/prints a specified file.

Parameters:
title - text that needs to be used to display bookmark
applicationOrFileToLaunch - pathname of the application or the file
print - whether to print the file
Returns:
a new bookmark placed immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addNext

public PdfBookmark addNext(String title,
                           String pdfFilePath,
                           int pageNo,
                           boolean newWindow)
                    throws PdfException
Adds a new bookmark (immediately after this bookmark) that can make the viewer application open a specified page of a another PDF document.

Parameters:
title - text used to display the bookmark
pdfFilePath - pathname of the PDF document that needs to be opened
pageNo - number number of the page that needs to be opened by default
newWindow - whether the other PDF document needs to be opened in a new window
Returns:
a new bookmark added immediately after this bookmark
Throws:
PdfException - if an illegal argument is supplied.

getParentNode

public PdfBookmark getParentNode()
Returns the bookmark to which this bookmark is a child bookmark.

Returns:
parent boomkark

getPrevious

public PdfBookmark getPrevious()
Returns bookmark that is immediately ahead of current bookmark.

Returns:
bookmark placed immediately ahead of current bookmark.
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0

getNext

public PdfBookmark getNext()
Returns bookmark that is immediately after current bookmark.

Returns:
bookmark placed immediately after current bookmark
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0

removeFirstchild

public void removeFirstchild()
                      throws PdfException
Deletes the first child bookmark of this bookmark.

Throws:
PdfException - if an illegal argument is supplied.

removePrevious

public void removePrevious()
                    throws PdfException
Removes the bookmark that is immediately before this bookmark.

Throws:
PdfException - if an illegal argument is supplied.

removeNext

public void removeNext()
                throws PdfException
Removes the bookmark that is immediately after this bookmark in this bookmark's level.

Throws:
PdfException - if an illegal argument is supplied.

getTitle

public String getTitle()
Retrieves text currently used to display this bookmark.

Returns:
text currently used to display the bookmark
Since:
1.0
See Also:
setTitle(java.lang.String)

setTitle

public void setTitle(String title)
Specifies text to be used to display this bookmark.

Parameters:
title - text to be used to display the bookmark
Since:
1.0
See Also:
getTitle()

getFirstChild

public PdfBookmark getFirstChild()
                          throws PdfException
Returns the first child bookmark under this bookmark.

Returns:
first child bookmark
Throws:
PdfException - if an illegal argument is supplied.

addActionGoto

public void addActionGoto(int pageNo,
                          double left,
                          double top,
                          double zoom)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to a destination specified by location (left, top), page pageNo, and magnification factor zoom.

Parameters:
pageNo - number of the destination page
left - x-coordinate of the top-left corner of the window on the page
top - y-coordinate of the top-left corner of the window on the page
zoom - magnification (zoom) factor to be applied when displaying the page
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addActionGoto

public void addActionGoto(int pageNo)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to a destination page specified by pageNo.

Parameters:
pageNo - number of the destination page
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addActionGoto

public void addActionGoto(int pageNo,
                          double pos,
                          int fit)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to a destination specified by pos and fit on page pageNo.
 
fit pos How page is displayed
FITH vertical coordinate of top-left corner of window on the page Page magnification (zoom) factor is adjusted to tightly fit the entire width of the page inside the window
FITBH vertical coordinate of top-left corner of window on the page Page magnification (zoom) factor is adjusted to tightly fit the entire width of its bounding box inside the window
FITBV horizontal coordinate of top-left corner of window on the page Page magnification (zoom) factor is adjusted to tightly fit the entire height of its bounding box inside the window
FITV horizontal coordinate of top-left corner of window on the page Page magnification (zoom) factor is adjusted to tightly fit the entire height of the page inside the window

Parameters:
pageNo - number of the destination page
pos - horizontal or vertical coordinate of top-left corner of the window on the page
fit - constant for specifying magnification (zoom) factor of the page
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addActionGoto

public void addActionGoto(int pageNo,
                          int fit)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to display entire height and width of a destination page pageNo tightly fit inside the window.

Parameters:
pageNo - number of the destination page
fit - constant determining how page needs to be displayed inside window; either FITB or FIT
Throws:
PdfException - if an illegal argument (constant other than FITB) is supplied.
Since:
1.0
Sample Code
See example.

addActionGoto

public void addActionGoto(int pageNo,
                          PdfRect rect)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to a rectangular area rect on a destination page pageNo.

Parameters:
pageNo - number of the destination page
rect - rectangular area on the destination page
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addActionGoto

public void addActionGoto(int pageNo,
                          double x,
                          double y,
                          double width,
                          double height)
                   throws PdfException
Adds to this bookmark a go-to action capable of changing the current view of the document to a specified rectangular area on a specified page.

Parameters:
pageNo - number of the page
x - x-coordinate of the top-left corner of the rectangular area
y - y-coordinate of the top-left corner of the rectangular area
width - width of the rectangular area
height - height of the rectangular area
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addActionLaunch

public void addActionLaunch(String applicationOrFileToLaunch,
                            boolean print)
Adds a launch action to this bookmark.

Parameters:
applicationOrFileToLaunch - pathname of application that needs to be executed or pathname of file that needs to be opened or printed (using the file's default application)
print - whether the file needs to be printed (using its default application)
Since:
1.0
Sample Code
See example.

addActionURI

public void addActionURI(String uri)
Adds a URI action to this bookmark.

Parameters:
uri - uniform resource indicator (URI) that needs to be resolved
Since:
1.0
Sample Code
See example.

addActionNamed

public void addActionNamed(int namedAction)
Adds a named action to this bookmark.

Parameters:
namedAction - constant specifying the named action
Since:
1.0
See Also:
PdfAction
Sample Code
See example.

addActionJavaScript

public void addActionJavaScript(String javascript)
Adds a Javascript action to this bookmark.

Parameters:
javascript - a Javascript script
Since:
1.0
Sample Code
See example.

addActionRemoteGoTo

public void addActionRemoteGoTo(String pdfFilePath,
                                PdfBookmark.RemoteGoTo rGoTo,
                                boolean newWindow)
                         throws PdfException
Adds a remote go-to action to this bookmark.

Parameters:
pdfFilePath - pathname of external PDF file
rGoTo - remote destination in the external PDF file
newWindow - whether the external PDF file needs to be opened in a new window
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addAction

public void addAction(PdfAction action)
               throws PdfException
Adds a specified document-level action. The specified action needs to be an object of a derived class of PdfAction.

Parameters:
action - action that the viewer applications need to perform when they open the document
Throws:
PdfException - if an illegal argument is supplied.
Sample Code
See example.

getAllActions

public List getAllActions()
Returns a list of all actions added to this bookmark.

Returns:
a list of all actions added to this bookmark

getAllActions

public List getAllActions(int type)
                   throws PdfException
Returns a list of actions of specified type that were added to this bookmark.

Parameters:
type - constant specifying the action type
Returns:
a list of actions of specified type that were added to this bookmark
Throws:
PdfException - if an illegal argument is supplied.

removeAllActions

public void removeAllActions()
Removes all actions added to this bookmark.


removeAction

public void removeAction(int type)
                  throws PdfException
Removes action of specified type from this bookmark. If more than one bookmark is available for a bookmark, then the first action will be removed.

Parameters:
type - constant specifying the action type
Throws:
PdfException - if an illegal argument is supplied.

removeAllActions

public void removeAllActions(int type)
                      throws PdfException
Removes all actions of specified type from this bookmark.

Parameters:
type - constant specifying the action type
Throws:
PdfException - if an illegal argument is supplied.

getColor

public Color getColor()
Retrieves color currently used to display this bookmark.

Returns:
color currently used to display the bookmark
Since:
1.0
See Also:
setColor(java.awt.Color)

setColor

public void setColor(Color color)
Specifies color to be used to display this bookmark.

Parameters:
color - color to be used to display the bookmark
Since:
1.0
See Also:
getColor(), setColorAndStyle(java.awt.Color, int)

getStyle

public int getStyle()
Retrieves font style currently used to display this bookmark.

Returns:
style currently used to display the bookmark
Since:
1.0
See Also:
setStyle(int)

setStyle

public void setStyle(int style)
Specifies font style to be used to display the bookmark.

Parameters:
style - style to be used to display the bookmark
Since:
1.0
See Also:
getStyle(), setColorAndStyle(java.awt.Color, int)

setColorAndStyle

public void setColorAndStyle(Color c,
                             int s)
Specifies font color and style to be used to display this bookmark. Combines the functions of the methods setColor and setStyle.

Parameters:
c - color to be used to display the bookmark
s - style to be used to display the bookmark
Since:
1.0
See Also:
setColor(java.awt.Color), setStyle(int)

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com