|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfLinkAnnot
This class represents a link annotation. It is used to link to a destination in the same document or in another document. It can also be used to specify actions for the viewer application to perform.
The location of a link annotation is specified using a
PdfRect
object. However, the position and size of a
PdfRect
object is applied in a literal sense. As a
result, the actual position of the link annotation on a page
is wholly dependent on whatever measurement unit that is currently
applicable. As this can cause serious shifts in position of
the link annotation, care has to taken when reusing a link
annotation in different places or in different situations.
Field Summary | |
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 |
HIGHLIGHT_MODE_INVERT
Highlight mode for displaying contents of annotation rectangle inverted. |
static int |
HIGHLIGHT_MODE_NONE
Highlight mode for displaying contents of annotation rectangle without any change from their normal appearance. |
static int |
HIGHLIGHT_MODE_OUTLINE
Highlight mode for displaying border of annotation rectangle inverted. |
static int |
HIGHLIGHT_MODE_PUSH
Highlight mode for displaying contents of annotation rectangle as if they were pushed from below the surface of the page. |
Constructor Summary | |
PdfLinkAnnot()
Zero-argument default constructor. |
|
PdfLinkAnnot(PdfRect r,
Color c)
Constructs a link annotation with specified annotation rectangle and annotation rectangle color. |
|
PdfLinkAnnot(PdfRect r,
int flags)
Constructs a link annotation with specified annotation rectangle and flags. |
|
PdfLinkAnnot(PdfRect r,
int flags,
Color c)
Constructs a link annotation with specified annotation rectangle, flags, and annotation rectangle color. |
|
PdfLinkAnnot(PdfRect r,
String subject,
String contents,
String title)
Constructs a link annotation with specified annotation rectangle, subject, contents, and title. |
|
PdfLinkAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Constructs a link annotation with specified annotation rectangle, subject, contents, title, and annotation rectangle color. |
|
PdfLinkAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Constructs a link annotation with specified annotation rectangle, subject, contents, title, and flags. |
|
PdfLinkAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
Constructs a link annotation with specified annotation rectangle, subject, contents, title, flags, and annotation rectangle. |
|
PdfLinkAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int highlightMode)
Constructs a link annotation with specified annotation rectangle, subject, contents, title, flags, annotation rectangle color, and highlight mode. |
Method Summary | |
void |
addAction(PdfAction action)
Adds specified action to the link annotation. |
void |
addActionGoTo(int pageNo)
Adds a go-to action to this link annotation linking it to page specified by pageNo . |
void |
addActionGoTo(int pageNo,
double left,
double top,
double zoom)
Adds a go-to action to this link annotation linking it to destination specified by position ( left , top ),
page pageNo , and magnification factor
zoom . |
void |
addActionGoTo(int pageNo,
double left,
double bottom,
double right,
double top)
Adds a go-to action to this link annotation linking it to specified rectangular area on specified page. |
void |
addActionGoTo(int pageNo,
double pos,
int fit)
Adds a go-to action to this link annotation linking it to destination specified by pos
and fit on page specified by pageNo . |
void |
addActionJavaScript(String script)
Adds an action to this annotation making it execute specified Javascript script. |
void |
addActionLaunch(String applicationToLaunch,
boolean print)
Adds an action to this link annotation making it launch specified application, or open or print specified document. |
void |
addActionNamed(int actionType)
Adds action to this link annotation making it perform specified named action. |
void |
addActionRemoteGoTo(String pdfFilePath,
PdfBookmark.RemoteGoTo rGoTo,
boolean newWindow)
Adds a remote go-to action to this link annotation. |
void |
addActionURI(String uri)
Adds an action to this link annotation making it launch specified Uniform Resource Identifier (URI). |
List |
getAllActions()
Returns a list of all actions added to this link annotation. |
List |
getAllActions(int type)
Returns all actions of specified type added to this link annotation. |
int |
getHighlightMode()
Returns constant identifying this link annotation's highlight mode. |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo)
Returns a remote go-to action that leads to page specified by pageNo . |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
double left,
double bottom,
double right,
double top)
Returns a remote go-to action that leads to specified rectangular area on specified page. |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
double pos,
int fit)
Returns a remote go-to action that leads to destination specified by pos and fit on page
specified by pageNo . |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
int fit)
Returns a remote go-to action that leads to page specified by pageNo and displays the page with its entire
height and width tightly fit inside the window. |
static PdfBookmark.RemoteGoTo |
getRemoteGoToInstance(int pageNo,
PdfRect rect)
Returns a remote go-to action that leads to specified rectangle on page specified by pageNo . |
void |
removeAction(int type)
Removes action of specified type that was first added to this link annotation. |
void |
removeAllActions()
Removes all actions that were added to this link annotation. |
void |
removeAllActions(int type)
Removes all actions of specified type that were added to this link annotation. |
void |
setHighlightMode(int highlightMode)
Specifies this link annotation's highlight mode. |
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, getType, hashCode, isDeleted, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setRect, setRect, setRect, setRect, setRect, setShowRect, setSubject, setTitle |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HIGHLIGHT_MODE_NONE
public static final int HIGHLIGHT_MODE_INVERT
public static final int HIGHLIGHT_MODE_OUTLINE
public static final int HIGHLIGHT_MODE_PUSH
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
Constructor Detail |
public PdfLinkAnnot()
public PdfLinkAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c, int highlightMode) throws IOException, PdfException
r
- annotation rectanglesubject
- text to be used as the annotation's subjectcontents
- text to be used as the annotation's contentstitle
- text to be displayed in the annotation's title barflags
- flag or combined value of flags representing
characteristics of the annotationc
- color of the annotation rectanglehighlightMode
- highlight modepublic PdfLinkAnnot(PdfRect r, String subject, String contents, String title) throws IOException, PdfException
r
- annotation rectanglesubject
- text to be used as the annotation's subjectcontents
- text to be used as the annotation's contentstitle
- text to be displayed in the annotation's title barpublic PdfLinkAnnot(PdfRect r, String subject, String contents, String title, Color c) throws IOException, PdfException
r
- annotation rectanglesubject
- text to be used as the annotation's subjectcontents
- text to be used as the annotation's contentstitle
- text to be displayed in the annotation's title barc
- color of the annotation rectanglepublic PdfLinkAnnot(PdfRect r, String subject, String contents, String title, int flags) throws IOException, PdfException
r
- annotation rectanglesubject
- text to be used as the annotation's subjectcontents
- text to be used as the annotation's contentstitle
- text to be displayed in the annotation's title barflags
- flag or combined value of flags representing
characteristics of the annotationpublic PdfLinkAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
r
- annotation rectanglesubject
- text to be used as the annotation's subjectcontents
- text to be used as the annotation's contentstitle
- text to be displayed in the annotation's title barflags
- flag or combined value of flags representing
characteristics of the annotationc
- color of the annotation rectanglepublic PdfLinkAnnot(PdfRect r, int flags) throws IOException, PdfException
r
- annotation rectangleflags
- flag or combined value of flags representing
characteristics of the annotationpublic PdfLinkAnnot(PdfRect r, int flags, Color c) throws IOException, PdfException
r
- annotation rectangleflags
- flag or combined value of flags representing
characteristics of the annotationc
- color of the annotation rectanglepublic PdfLinkAnnot(PdfRect r, Color c) throws IOException, PdfException
r
- annotation rectanglec
- color of the annotation rectangleMethod Detail |
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo)
pageNo
.
pageNo
- number of the page
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double pos, int fit)
pos
and fit
on page
specified by pageNo
. As this is a remote
destination, the coordinates of pos
are
specified assuming that position (0, 0) represents the
bottom-left corner of the page.
fit |
pos |
How page is displayed |
---|---|---|
FITH |
vertical coordinate of top-left corner of window on the page |
|
FITBH |
vertical coordinate of top-left corner of window on the page |
|
FITBV |
horizontal coordinate of top-left corner of window on the page |
|
FITV |
horizontal coordinate of top-left corner of window on the page |
|
pageNo
- number of the pagepos
- horizontal or vertical coordinate of top-left
corner of window on the pagefit
- constant for specifying magnification (zoom) factor
of the page
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, int fit)
pageNo
and displays the page with its entire
height and width tightly fit inside the window.
pageNo
- number of the pagefit
- constant for specifying magnification (zoom) factor
of the page (Always is FITB
)
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, PdfRect rect)
pageNo
.
pageNo
- number of the pagerect
- rectangle on the page
public static PdfBookmark.RemoteGoTo getRemoteGoToInstance(int pageNo, double left, double bottom, double right, double top)
pageNo
- number of the pageleft
- distance from left edge of the page to the left
edge of the rectangular areabottom
- distance from bottom edge of the page to the
bottom edge of the rectangular arearight
- distance from right edge of the page to the left
edge of the rectangular areatop
- distance from top edge of the page to the bottom
edge of the rectangular area
public int getHighlightMode()
setHighlightMode(int)
public void setHighlightMode(int highlightMode)
highlightMode
- constant specifying the highlight modepublic void addActionGoTo(int pageNo, double left, double top, double zoom) throws PdfException
left
, top
),
page pageNo
, and magnification factor
zoom
.
pageNo
- destination page numberleft
- 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 page
PdfException
- if an illegal argument is supplied.public void addActionGoTo(int pageNo, double pos, int fit) throws PdfException
pos
and fit
on page specified by pageNo
.
fit |
pos |
How page is displayed |
---|---|---|
FITH |
vertical coordinate of top-left corner of window on the page |
|
FITBH |
vertical coordinate of top-left corner of window on the page |
|
FITBV |
horizontal coordinate of top-left corner of window on the page |
|
FITV |
horizontal coordinate of top-left corner of window on the page |
|
pageNo
- number of the 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, double left, double bottom, double right, double top) throws PdfException
pageNo
- number of the pageleft
- distance from the left edge of the page to the left
edge of the annotation rectanglebottom
- distance from the top edge of the page to the bottom
edge of the annotation rectangleright
- distance from the left edge of the page to the right
edge of the annotation rectangletop
- distance from the top edge of the page to the top
edge of the annotation rectangle
PdfException
- if an illegal argument is supplied.public void addActionRemoteGoTo(String pdfFilePath, PdfBookmark.RemoteGoTo rGoTo, boolean newWindow) throws PdfException
pdfFilePath
- pathname of the PDF file containing the action's
destinationrGoTo
- remote go-to actionnewWindow
- whether a new window is to be opened to perform the
remote go-to action
PdfException
- if an illegal argument is supplied.public void addActionNamed(int actionType)
actionType
- named actionpublic void addActionLaunch(String applicationToLaunch, boolean print)
applicationToLaunch
- pathname of the application or documentprint
- whether the document is to be printedpublic void addAction(PdfAction action) throws PdfException
action
- an object of a derived class of PdfAction
PdfException
- if an illegal argument is supplied.public List getAllActions()
public List getAllActions(int type) throws PdfException
type
- constant
specifying
annotation type
PdfException
- if an illegal argument is supplied.public void addActionURI(String uri)
uri
- Uniform Resource Identifier (URI) that needs to be
launchedpublic void addActionJavaScript(String script)
script
- Javascript script that needs to be executedpublic void removeAction(int type) throws PdfException
type
- constant specifying the action type
PdfException
- if an illegal argument is supplied.PdfAction
public void removeAllActions(int type) throws PdfException
type
- constant specifying the action type
PdfException
- if an illegal argument is supplied.PdfAction
public void removeAllActions()
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |