public class Link extends Annot
Link
represents the link annotation.
It offers specific properties get/set method for link annotation.
Before call all methods in this class,
please note to call
at first.PDFPage.loadAnnots()
Annot.Border, Annot.QuadpointsF
BORDERSTYLE_BEVELED, BORDERSTYLE_CLOUDY, BORDERSTYLE_DASHED, BORDERSTYLE_INSET, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_LOCKEDCONTENTS, FLAG_NOROTATE, FLAG_NOVIEW, FLAG_NOZOOM, FLAG_PRINT, FLAG_READONLY, FLAG_TOGGLENOVIEW, HIGHLIGHTINGMODE_INVERT, HIGHLIGHTINGMODE_NONE, HIGHLIGHTINGMODE_OUTLINE, HIGHLIGHTINGMODE_PUSH, HIGHLIGHTINGMODE_TOGGLE, MKENTRY_BACKGROUNDCOLOR, MKENTRY_BORDERCOLOR, MKENTRY_DOWNCAPTION, MKENTRY_DOWNICON, MKENTRY_ICONFIT, MKENTRY_NORMALCAPTION, MKENTRY_NORMALICON, MKENTRY_ROLLOVERCAPTION, MKENTRY_ROLLOVERICON, MKENTRY_ROTATION, MKENTRY_TEXTPOSITION, TRIGGER_ANNOT_CE, TRIGGER_ANNOT_CX, TRIGGER_ANNOT_FL, TRIGGER_ANNOT_FO, TRIGGER_ANNOT_MD, TRIGGER_ANNOT_MU, TRIGGER_ANNOT_PC, TRIGGER_ANNOT_PI, TRIGGER_ANNOT_PO, TRIGGER_ANNOT_PV, TYPE_3D, TYPE_CARET, TYPE_CIRCLE, TYPE_FILEATTACHMENT, TYPE_FREETEXT, TYPE_HIGHLIGHT, TYPE_INK, TYPE_LINE, TYPE_LINK, TYPE_MOVIE, TYPE_POLYGON, TYPE_POLYLINE, TYPE_POPUP, TYPE_PRINTERMARK, TYPE_PSI, TYPE_SCREEN, TYPE_SOUND, TYPE_SQUARE, TYPE_SQUIGGLY, TYPE_STAMP, TYPE_STRIKEOUT, TYPE_TEXT, TYPE_TRAPNET, TYPE_UNDERLINE, TYPE_WATERMARK, TYPE_WIDGET
Modifier and Type | Method and Description |
---|---|
int |
countActions(int trigger)
Count actions associated with current link annotation.
|
PDFAction |
getAction(int trigger,
int index)
Get action data of specific index associated with current link annotation.
|
int |
getHighlightingMode()
Get highlighting mode of current link annotation.
|
Annot.QuadpointsF[] |
getQuadPoints()
Get quadrilaterals points of current link annotation.
|
void |
insertAction(int trigger,
int index,
PDFAction action)
Insert action data of specified index associated with current link annotation.
|
boolean |
removeAction(int trigger,
int index)
Remove an action of specified index associated with current link annotation.
|
boolean |
removeAllActions(int trigger)
Remove all the actions associated with current link annotation.
|
void |
resetAppearance()
Reset(regenerate) appearance of current link annotation.
|
boolean |
setAction(int trigger,
int index,
PDFAction action)
Set action data of specified index associated with current link annotation.
|
void |
setHighLightingMode(int hlMode)
Set highlighting mode of current link annotation.
|
void |
setQuadPoints(Annot.QuadpointsF[] quadPoints)
Set quadrilaterals points of current link annotation.
|
getBorder, getBorderColor, getContents, getDeviceRect, getFlags, getHandle, getIndex, getModifiedDateTime, getName, getRect, getType, isMarkup, move, setBorder, setBorderColor, setContents, setFlags, setIconProvider, setModifiedDateTime, setName
public int getHighlightingMode() throws PDFException
HIGHLIGHTINGMODE_XXX
\
. PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setHighLightingMode(int hlMode) throws PDFException
hlMode
- Highlighting mode to be set to the annotation. It should be
one of the following:
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Annot.QuadpointsF[] getQuadPoints() throws PDFException
QuadpointsF
objects array that receives
array of quadrilaterals points of current link annotation. The order of
quadrilaterals points will be as follow:
(x1, y1) (x2, y2) ---------------- | | | | ---------------- (x3, y3) (x4, y4)If not found, it will return
null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Annot.QuadpointsF
public void setQuadPoints(Annot.QuadpointsF[] quadPoints) throws PDFException
quadPoints
- A QuadpointsF
objects array that specifies
quadrilaterals points to be set to the annotation. This must
be valid. The order of quadrilaterals points will be as
follow:
(x1, y1) (x2, y2) ---------------- | | | | ---------------- (x3, y3) (x4, y4)
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Annot.QuadpointsF
public int countActions(int trigger) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.integer
value that specified the count of
actions.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public PDFAction getAction(int trigger, int index) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.index
- The index of actions. Range: 0 to (actioncount-1).
actioncount
is returned by function
countActions(int)
with same
parameter trigger
.PDFAction
object that receives the specific
action.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAction
public boolean setAction(int trigger, int index, PDFAction action) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.index
- Index of the action which will be replaced by new action.
Range: 0 to (actioncount
-1).
actioncount
is returned by function
countActions(int)
.action
- A PDFAction
object that specific the new action
which is to be set to annotation.true
if set successfully, else return
false
for the parameter index
is out of
range.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAction
public void insertAction(int trigger, int index, PDFAction action) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.index
- An integer value that specifies the position to insert new
action. Range: 0 to (actioncount
-1).
actioncount
is returned by function
countActions(int)
. If it's out of
the range, parameter action
will be inserted to
the last.action
- A PDFAction
object that specific the new action
which is to be inserted to annotation.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFAction
public boolean removeAction(int trigger, int index) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.index
- An integer
value that specifies action to be removed. Range: 0
to (actioncount
-1). actioncount
is
returned by function
countActions(int)
.true
if removed successfully, else return
false
for the specified index
is out of
range.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean removeAllActions(int trigger) throws PDFException
trigger
- The trigger of action. Please refer to
TRIGGER_ANNOT_XXX
and this should be one of them.true
if removed successfully, else return
false
for not found the specified trigger actions.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void resetAppearance() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException