public class Markup extends Annot
Markup
represents base class for markup annotations.
It offers common properties get/set method for all markup annotations.
Before call all methods in this class,
please note to call
at first.PDFPage.loadAnnots()
PDFPage
Annot.Border, Annot.QuadpointsF
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INTENTNAME_FREETEXT_CALLOUT
FreeText annotation intent name: FreeTextCallout.
|
static java.lang.String |
INTENTNAME_FREETEXT_TYPEWRITER
FreeText annotation intent name: FreeTextTypewriter.
|
static java.lang.String |
INTENTNAME_LINE_ARROW
Line annotation intent name: LineArrow.
|
static java.lang.String |
INTENTNAME_LINE_DIMENSION
Line annotation intent name: LineDimension.
|
static java.lang.String |
INTENTNAME_POLYGON_CLOUD
Polygon annotation intent name: PolygonCloud.
|
static java.lang.String |
INTENTNAME_POLYGON_DIMENSION
Polygon annotation intent name: PolygonDimension.
|
static java.lang.String |
INTENTNAME_POLYLINE_DIMENSION
PolyLine annotation intent name: PolyLineDimension.
|
static java.lang.String |
LINEENDINGSTYLE_BUTT
Line ending style name: Butt.
|
static java.lang.String |
LINEENDINGSTYLE_CIRCLE
Line ending style name: Circle.
|
static java.lang.String |
LINEENDINGSTYLE_CLOSEDARROW
Line ending style name: ClosedArrow.
|
static java.lang.String |
LINEENDINGSTYLE_DIAMOND
Line ending style name: Diamond.
|
static java.lang.String |
LINEENDINGSTYLE_NONE
Line ending style name: None.
|
static java.lang.String |
LINEENDINGSTYLE_OPENARROW
Line ending style name: OpenArrow.
|
static java.lang.String |
LINEENDINGSTYLE_REVERSECLOSEDARROW
Line ending style name: RClosedArrow.
|
static java.lang.String |
LINEENDINGSTYLE_REVERSEOPENARROW
Line ending style name: ROpenArrow.
|
static java.lang.String |
LINEENDINGSTYLE_SLASH
Line ending style name: Slash.
|
static java.lang.String |
LINEENDINGSTYLE_SQUARE
Line ending style name: Square.
|
static int |
STATE_MARKED_MARKED
The state of marked model is marked
|
static int |
STATE_MARKED_UNMARKED
The state of marked model is unmarked
|
static int |
STATE_REVIEW_ACCEPTED
The state of review model is accepted
|
static int |
STATE_REVIEW_CANCELLED
The state of review model is canceled
|
static int |
STATE_REVIEW_COMPLETED
The state of review model is completed
|
static int |
STATE_REVIEW_NONE
The state of review model is none
|
static int |
STATE_REVIEW_REJECTED
The state of review model is rejected
|
static int |
STATEMODEL_MARKED
State model is marked
|
static int |
STATEMODEL_REVIEW
State model is review
|
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 |
---|---|
Markup |
addState(int stateModel,
int state)
Add a specific state to current markup annotation.
|
int |
countReplies()
Count replies of current markup annotation.
|
int |
countStateAnnots(int stateModel)
Count specific state annotations associated with current markup annotation.
|
DateTime |
getCreationDateTime()
Get creation time of current markup annotation.
|
Markup[] |
getGroupElements()
Get group elements if annotation is in a group, including itself.
|
Markup |
getGroupHeader()
Get header annotation of a group which current annotation belongs to.
|
java.lang.String |
getIntent()
Get intent of current markup annotation.
|
float |
getOpacity()
Get opacity of current markup annotation.
|
Markup |
getReply(int index)
Get reply of current markup annotation, with specific index.
|
int[] |
getState()
Get state out of current state text annotation.
|
Markup |
getStateAnnot(int stateModel,
int index)
Get specified state annotation associated with current markup annotation.
|
java.lang.String |
getSubject()
Get subject of current markup annotation.
|
java.lang.String |
getTitle()
Get title of current markup annotation.
|
Markup |
insertReply(int index)
Insert a new empty reply with a specified index to current markup annotation.
|
boolean |
isGrouped()
Checks whether current annotation is in a group or not.
|
boolean |
isTextMarkup()
Checks whether current annotation is a
TextMarkup
annotation. |
void |
removeAllReplies()
Remove all the replies of current markup annotation.
|
void |
removeAllStates()
Remove all the state annotations associated with current markup annotation.
|
boolean |
removeReply(int index)
Remove a reply with specified index from current markup annotation.
|
void |
setCreationDateTime(DateTime dateTime)
Set creation time of current markup annotation.
|
static void |
setGroup(Markup[] annots,
int headerIndex)
Group all the input annotations.
|
void |
setIntent(java.lang.String intent)
Set intent of current markup annotation.
|
void |
setOpacity(float opacity)
Set opacity of current markup annotation.
|
void |
setState(int stateModel,
int state)
Set state model and state of current state annotation.
|
void |
setSubject(java.lang.String subject)
Set subject of current markup annotation.
|
void |
setTitle(java.lang.String title)
Set title of current markup annotation.
|
void |
unGroup()
Ungroup current markup annotation from the group.
|
getBorder, getBorderColor, getContents, getDeviceRect, getFlags, getHandle, getIndex, getModifiedDateTime, getName, getRect, getType, isMarkup, move, setBorder, setBorderColor, setContents, setFlags, setIconProvider, setModifiedDateTime, setName
public static final java.lang.String INTENTNAME_FREETEXT_CALLOUT
public static final java.lang.String INTENTNAME_FREETEXT_TYPEWRITER
public static final java.lang.String INTENTNAME_LINE_ARROW
public static final java.lang.String INTENTNAME_LINE_DIMENSION
public static final java.lang.String INTENTNAME_POLYGON_CLOUD
public static final java.lang.String INTENTNAME_POLYGON_DIMENSION
public static final java.lang.String INTENTNAME_POLYLINE_DIMENSION
public static final java.lang.String LINEENDINGSTYLE_NONE
public static final java.lang.String LINEENDINGSTYLE_SQUARE
public static final java.lang.String LINEENDINGSTYLE_CIRCLE
public static final java.lang.String LINEENDINGSTYLE_DIAMOND
public static final java.lang.String LINEENDINGSTYLE_OPENARROW
public static final java.lang.String LINEENDINGSTYLE_CLOSEDARROW
public static final java.lang.String LINEENDINGSTYLE_BUTT
public static final java.lang.String LINEENDINGSTYLE_REVERSEOPENARROW
public static final java.lang.String LINEENDINGSTYLE_REVERSECLOSEDARROW
public static final java.lang.String LINEENDINGSTYLE_SLASH
public static final int STATEMODEL_MARKED
public static final int STATEMODEL_REVIEW
public static final int STATE_MARKED_MARKED
public static final int STATE_MARKED_UNMARKED
public static final int STATE_REVIEW_ACCEPTED
public static final int STATE_REVIEW_REJECTED
public static final int STATE_REVIEW_CANCELLED
public static final int STATE_REVIEW_COMPLETED
public static final int STATE_REVIEW_NONE
public boolean isTextMarkup() throws PDFException
TextMarkup
annotation.boolean
value that indicates whether the
annotation is text markup or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
TextMarkup
public java.lang.String getSubject() throws PDFException
String
object that receives value of subject
property. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getTitle() throws PDFException
String
object that receives value of title
property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float getOpacity() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public DateTime getCreationDateTime() throws PDFException
DateTime
object that receives value of creation
time property.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime
public java.lang.String getIntent() throws PDFException
String
object that receives value of intent
property. Please refer to the definitions
INTENTNAME_XXX
and this should be one of these constants.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setSubject(java.lang.String subject) throws PDFException
subject
- A String
object that specifies value of subject
property. It can be null
or empty.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setTitle(java.lang.String title) throws PDFException
By convention, this entry can used to identify the user who added the annotation.
title
- A String
object that specifies value of title
property. It can be null or empty.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setOpacity(float opacity) throws PDFException
opacity
- Opacity value to be set to the annotation. Valid range is from
0.0 to 1.0.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCreationDateTime(DateTime dateTime) throws PDFException
dateTime
- A DateTime
object that specifies value of
creation time property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime
public void setIntent(java.lang.String intent) throws PDFException
For annotations such as FreeText, Line, Polygon and Polyline, intent name has been predefined.
intent
- Specify value of intent property. Please refer to constants
definitions INTENTNAME_XXX
and this can be one of these constants
(with same annotation type) for free text, line, polygon, and
polyline annotations. Currently,
INTENTNAME_POLYGON_DIMENSION
for polygon annotation.INTENTNAME_POLYLINE_DIMENSION
for polyline annotation.INTENTNAME_LINE_DIMENSION
for line annotation.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int countStateAnnots(int stateModel) throws PDFException
The markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation by means of its IRT entry. This function provided to count these state text annotations with the specific state model. For more details, please refer to PDF Reference 1.7 P620 "Annotation States".
stateModel
- An integer
value that specifies state model.
Please refer to constants definitions
STATEMODEL_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup addState(int stateModel, int state) throws PDFException
stateModel
- An integer
value that specifies the state model.
Please refer to constants definitions
STATEMODEL_XXX
and this should be one of these constants.state
- An integer
value that specifies the state. Please
refer to constants definitions
STATE_XXX
and
this should be one of these constants.Markup
object which receive the state annotation.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup getStateAnnot(int stateModel, int index) throws PDFException
The markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation by means of its IRT entry. This function provided to count these state text annotations with the specific state model. For more details, please refer to PDF Reference 1.7 P620 "Annotation States".
stateModel
- An integer
value that specifies state model.
Please refer to constants definitions
STATEMODEL_XXX
and
this should be one of these constants.index
- The index of state annotations to be got. Range: 0 to (
annotcount
-1). annotcount
is
returned by function
countStateAnnots(int)
with the same
parameter stateModel
.Markup
object that receives the state annotation,
which is a markup annotation.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setState(int stateModel, int state) throws PDFException
stateModel
- An integer
value that specifies the state model.
Please refer to constants definitions
STATEMODEL_XXX
and this should be one of these constants.state
- An integer
value that specifies the state. Please
refer to constants definitions
STATE_XXX
and
this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int[] getState() throws PDFException
The markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation by means of its IRT entry. This function provided to count these state text annotations with the specific state model. For more details, please refer to PDF Reference 1.7 P620 "Annotation States".
integer
array with two elements that receives the
state and state model. The first is state model. Please refer to
constants definitions STATEMODEL_XXX
and this should be one of these constants.
If there's any error, it will be set -1.STATE_XXX
and this should be one of these constants. PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void removeAllStates() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean isGrouped() throws PDFException
boolean
value that receives the result.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static void setGroup(Markup[] annots, int headerIndex) throws PDFException
annots
- A Markup
objects array that specifies a series of
markup annotation. This array should contain at least 2
elements.headerIndex
- Index of a markup annotation in the input annotation array.
Annotation with this index will become the group header.
Range: 0 to (count
-1). count
is the
size of the input annotation array.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void unGroup() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup getGroupHeader() throws PDFException
Markup
object that receives the header annotation.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup[] getGroupElements() throws PDFException
This function only supports markup annotations.
Markup
objects array that receives the group
elements.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int countReplies() throws PDFException
integer
value that receives count of replies.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup getReply(int index) throws PDFException
index
- The index of reply annotations. Range: 0 to (
replycount
-1). replycount
is
returned by function
countReplies()
.Markup
object that receives specific reply
annotation.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Markup insertReply(int index) throws PDFException
Currently, this function only support to insert reply to the last.
Parameter index
is reserved and should be -1.
index
- (Reserved and no effect currently. It should be -1 and new
reply will be inserted to the last.)replycount
is returned by function
countReplies()
. If it's out of the
range, the new reply will be inserted to the last.Markup
object that receives the new reply
annotation.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean removeReply(int index) throws PDFException
index
- Index of the reply annotations to be removed. Range: 0 to
(replycount-1). replycount
is returned by
function countReplies()
.true
if removed the specified reply annotation
successfully, else return false
for failure.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void removeAllReplies() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException