|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfNode
com.gnostice.pdfone.PdfBookmark
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 (hereafterward 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.
Nested Class Summary | |
static class |
PdfBookmark.RemoteGoTo
|
Field Summary | |
static int |
BOLD
Constant for displaying titles of bookmarks in bold type. |
static int |
FITB
Constant for adjusting magnification (zoom) factor of a page to tightly fit entire height and width of its bounding box inside a window. |
static int |
FITBH
Constant for adjusting magnification (zoom) factor of a page to tightly fit entire width of its bounding box inside a window. |
static int |
FITBV
Constant for adjusting magnification (zoom) factor of a page to tightly fit entire height of its bounding box inside a window. |
static int |
FITH
Constant for adjusting magnification (zoom) factor of a page to tightly fit its entire width inside a window. |
static int |
FITV
Constant for adjusting magnification (zoom) factor of a page 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)
|
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 ( left , top ),
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)
|
PdfBookmark |
addNext(String title,
String pdfFilePath,
int pageNo,
boolean newWindow)
|
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)
|
PdfBookmark |
addPrevious(String title,
String pdfFilePath,
int pageNo,
boolean newWindow)
|
List |
getAllActions()
|
List |
getAllActions(int type)
|
Color |
getColor()
Retrieves color currently used to display this bookmark. |
PdfBookmark |
getFirstChild()
|
PdfBookmark |
getNext()
Returns bookmark that is immediately after current bookmark. |
PdfBookmark |
getParentNode()
|
PdfBookmark |
getPrevious()
Returns bookmark that is immediately ahead of current bookmark. |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo)
|
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
double left,
double bottom,
double right,
double top)
|
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
double pos,
int fit)
|
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
int fit)
|
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
PdfRect rect)
|
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)
|
void |
removeAllActions()
|
void |
removeAllActions(int type)
|
void |
removeFirstchild()
|
void |
removeNext()
|
void |
removePrevious()
|
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 |
public static final int FITH
public static final int FITBH
public static final int FITBV
public static final int FITV
public static final int FITB
public static final int BOLD
public static final int ITALIC
Method Detail |
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo)
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double pos, int fit)
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, int fit)
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, PdfRect rect)
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double left, double bottom, double right, double top)
public PdfBookmark addPrevious(String title, int pageNo, double left, double top, double zoom) throws PdfException
left
, top
),
page pageNo
, and page magnification factor
zoom
.
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pageleft
- x-coordinate of the destination positiontop
- y-coordinate of the destination positionzoom
- page magnification factor with which the destination
page needs to be displayed
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, int pageNo) throws PdfException
pageNo
and inserts it immediately ahead of
this bookmark.
title
- text that needs to be used to display the bookmarkpageNo
- number of the page
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, int pageNo, double pos, int fit) throws PdfException
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. |
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pagepos
- horizontal or vertical coordinate of the bookmark's
destinationfit
- constant determining how page needs to be displayed
inside window
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, int pageNo, int fit) throws PdfException
pageNo
and fit
.
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pagefit
- FITB
or constant specifiying that entire height
and width of the page's bounding box must be tightly fit
within the window
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, int pageNo, PdfRect rect) throws PdfException
title
- text that needs to be used to display the bookmarkpageNo
- number of the page that needs to be displayed when
the bookmark is selectedrect
- rectangular area on the page
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, int pageNo, double x, double y, double width, double height) throws PdfException
title
- text that needs to be used to display bookmarkpageNo
- number of the pagex
- x-coordinate of the top-left corner of the
rectangular areay
- y-coordinate of the top-left corner of the
rectangular areawidth
- width of the rectangular areaheight
- height of the rectangular area
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(int namedAction, String title) throws PdfException
namedAction
- constant specifying the named actiontitle
- text that needs to be used to display the bookmark
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, String javascriptOrURI, int actionType) throws PdfException
PdfException
public PdfBookmark addPrevious(String title, String applicationOrFileToLaunch, boolean print) throws PdfException
title
- text that needs to be used to display bookmarkapplicationOrFileToLaunch
- pathname of the application or the fileprint
- whether to print the file
PdfException
- if an illegal argument is supplied.public PdfBookmark addPrevious(String title, String pdfFilePath, int pageNo, boolean newWindow) throws PdfException
PdfException
public PdfBookmark addNext(String title, int pageNo, double left, double top, double zoom) throws PdfException
left
, top
),
page pageNo
, and page magnification factor
zoom
.
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pageleft
- x-coordinate of the destination positiontop
- y-coordinate of the destination positionzoom
- page magnification factor with which the destination
page needs to be displayed
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, int pageNo) throws PdfException
title
- text that needs to be used to display the bookmarkpageNo
- number of the page
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, int pageNo, double pos, int fit) throws PdfException
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. |
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pagepos
- horizontal or vertical coordinate of the bookmark's
destinationfit
- constant determining how page needs to be displayed
inside window
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, int pageNo, int fit) throws PdfException
pageNo
and fit
.
title
- text that needs to be used to display the bookmarkpageNo
- number of the destination pagefit
- FITB
or constant specifiying that entire
height and width of the page's bounding box must
be tightly fit within the window
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, int pageNo, PdfRect rect) throws PdfException
title
- text that needs to be used to display the bookmarkpageNo
- number of the page that needs to be displayed when
the bookmark is selectedrect
- rectangular area on the page
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, int pageNo, double x, double y, double width, double height) throws PdfException
title
- text that needs to be used to display the bookmarkpageNo
- number of the pagex
- x-coordinate of the top-left corner of the
rectangular areay
- y-coordinate of the top-left corner of the
rectangular areawidth
- width of the rectangular areaheight
- height of the rectangular area
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(int namedAction, String title) throws PdfException
namedAction
- constant specifying the named actiontitle
- text that needs to be used to display the bookmark
PdfException
- if an illegal argument is supplied.PdfAction
public PdfBookmark addNext(String title, String javascriptOrURI, int actionType) throws PdfException
PdfException
public PdfBookmark addNext(String title, String applicationOrFileToLaunch, boolean print) throws PdfException
title
- text that needs to be used to display bookmarkapplicationOrFileToLaunch
- pathname of the application or the fileprint
- whether to print the file
PdfException
- if an illegal argument is supplied.public PdfBookmark addNext(String title, String pdfFilePath, int pageNo, boolean newWindow) throws PdfException
PdfException
public PdfBookmark getParentNode()
public PdfBookmark getPrevious()
PdfException
- if an illegal argument is supplied.public PdfBookmark getNext()
PdfException
- if an illegal argument is supplied.public void removeFirstchild() throws PdfException
PdfException
public void removePrevious() throws PdfException
PdfException
public void removeNext() throws PdfException
PdfException
public String getTitle()
setTitle(java.lang.String)
public void setTitle(String title)
title
- text to be used to display the bookmarkgetTitle()
public PdfBookmark getFirstChild() throws PdfException
PdfException
public void addActionGoto(int pageNo, double left, double top, double zoom) throws PdfException
left
, top
),
page pageNo
, and magnification factor
zoom
.
pageNo
- number of the destination pageleft
- x-coordinate of the top-left corner of the
window on the pagetop
- y-coordinate of the top-left corner of the
window on the pagezoom
- magnification (zoom) factor to be applied when
displaying the page
PdfException
- if an illegal argument is supplied.public void addActionGoto(int pageNo) throws PdfException
pageNo
.
pageNo
- number of the destination page
PdfException
- if an illegal argument is supplied.public void addActionGoto(int pageNo, double pos, int fit) throws PdfException
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 |
pageNo
- number of the destination pagepos
- horizontal or vertical coordinate of top-left
corner of the window on the pagefit
- constant for specifying magnification (zoom) factor
of the page
PdfException
- if an illegal argument is supplied.public void addActionGoto(int pageNo, int fit) throws PdfException
pageNo
tightly fit inside the window.
pageNo
- number of the destination pagefit
- constant determining how page needs to be displayed
inside window (Always is FITB
)
PdfException
- if an illegal argument (constant other than
FITB
) is supplied.public void addActionGoto(int pageNo, PdfRect rect) throws PdfException
rect
on a
destination
page pageNo
.
pageNo
- number of the destination pagerect
- rectangular area on the destination page
PdfException
- if an illegal argument is supplied.public void addActionGoto(int pageNo, double x, double y, double width, double height) throws PdfException
pageNo
- number of the pagex
- x-coordinate of the top-left corner of the
rectangular areay
- y-coordinate of the top-left corner of the
rectangular areawidth
- width of the rectangular areaheight
- height of the rectangular area
PdfException
- if an illegal argument is supplied.public void addActionLaunch(String applicationOrFileToLaunch, boolean print)
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)public void addActionURI(String uri)
uri
- uniform resource indicator (URI) that needs to be
resolvedpublic void addActionNamed(int namedAction)
namedAction
- constant specifying the named actionPdfAction
public void addActionJavaScript(String javascript)
javascript
- a Javascript scriptpublic void addActionRemoteGoTo(String pdfFilePath, PdfBookmark.RemoteGoTo rGoTo, boolean newWindow) throws PdfException
pdfFilePath
- pathname of external PDF filerGoTo
- remote destination in the external PDF filenewWindow
- whether the external PDF file needs to be opened in
a new window
PdfException
- if an I/O error occurs.public void addAction(PdfAction action) throws PdfException
PdfException
public List getAllActions()
public List getAllActions(int type) throws PdfException
PdfException
public void removeAllActions()
public void removeAction(int type) throws PdfException
PdfException
public void removeAllActions(int type) throws PdfException
PdfException
public Color getColor()
setColor(java.awt.Color)
public void setColor(Color color)
color
- color to be used to display the bookmarkgetColor()
,
setColorAndStyle(java.awt.Color, int)
public int getStyle()
setStyle(int)
public void setStyle(int style)
style
- style to be used to display the bookmarkgetStyle()
,
setColorAndStyle(java.awt.Color, int)
public void setColorAndStyle(Color c, int s)
setColor
and setStyle
.
c
- color to be used to display the bookmarks
- style to be used to display the bookmarksetColor(java.awt.Color)
,
setStyle(int)
|
Pro. Ed. v1.41 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |