public class FreeText extends Markup
FreeText
represents the PDF free text annotation.
It offers specific properties get/set method for free text annotation.
Before call all methods in this class,
please note to call
at first.PDFPage.loadAnnots()
Annot.Border, Annot.QuadpointsF
INTENTNAME_FREETEXT_CALLOUT, INTENTNAME_FREETEXT_TYPEWRITER, INTENTNAME_LINE_ARROW, INTENTNAME_LINE_DIMENSION, INTENTNAME_POLYGON_CLOUD, INTENTNAME_POLYGON_DIMENSION, INTENTNAME_POLYLINE_DIMENSION, LINEENDINGSTYLE_BUTT, LINEENDINGSTYLE_CIRCLE, LINEENDINGSTYLE_CLOSEDARROW, LINEENDINGSTYLE_DIAMOND, LINEENDINGSTYLE_NONE, LINEENDINGSTYLE_OPENARROW, LINEENDINGSTYLE_REVERSECLOSEDARROW, LINEENDINGSTYLE_REVERSEOPENARROW, LINEENDINGSTYLE_SLASH, LINEENDINGSTYLE_SQUARE, STATE_MARKED_MARKED, STATE_MARKED_UNMARKED, STATE_REVIEW_ACCEPTED, STATE_REVIEW_CANCELLED, STATE_REVIEW_COMPLETED, STATE_REVIEW_NONE, STATE_REVIEW_REJECTED, STATEMODEL_MARKED, STATEMODEL_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 |
---|---|
int |
getAlignment()
Get alignment of current free text annotation.
|
android.graphics.PointF[] |
getCalloutLinePoints()
Get callout line points of current free text annotation.
|
DefaultAppearance |
getDefaultAppearance()
Get default appearance of current free text annotation, which can be used in
formatting text.
|
long |
getFillColor()
Get fill color of current free text annotation.
|
float[] |
getInnerRectMargin()
Get the margin between inner rectangle and rectangle of current free text
annotation.
|
java.lang.String[] |
getLineEndingStyles()
Get line ending styles of current free text annotation.
|
void |
resetAppearance()
Reset(regenerate) appearance of current free text annotation.
|
void |
setAlignment(int alignment)
Set alignment of current free text annotation.
|
void |
setCalloutLinePoints(android.graphics.PointF pt1,
android.graphics.PointF pt2,
android.graphics.PointF pt3)
Set callout line points of a free text annotation.
|
void |
setDefaultAppearance(DefaultAppearance defaultAppearance)
Set default appearance of current free text annotation, which can be used in
formatting the text.
|
void |
setFillColor(long color)
Set fill color of current free text annotation.
|
void |
setInnerRectMargin(float[] values)
Set the inner rectangle of current free text annotation.
|
void |
setLineEndingStyle(java.lang.String startingStyle,
java.lang.String endingStyle)
Set line ending styles of current free text annotation.
|
addState, countReplies, countStateAnnots, getCreationDateTime, getGroupElements, getGroupHeader, getIntent, getOpacity, getReply, getState, getStateAnnot, getSubject, getTitle, insertReply, isGrouped, isTextMarkup, removeAllReplies, removeAllStates, removeReply, setCreationDateTime, setGroup, setIntent, setOpacity, setState, setSubject, setTitle, unGroup
getBorder, getBorderColor, getContents, getDeviceRect, getFlags, getHandle, getIndex, getModifiedDateTime, getName, getRect, getType, isMarkup, move, setBorder, setBorderColor, setContents, setFlags, setIconProvider, setModifiedDateTime, setName
public long getFillColor() throws PDFException
long
value that receives value of fill color
property.Format: 0xAARRGGBB, and alpha value is ignored.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int getAlignment() throws PDFException
integer
value that receives value of alignment
property. It should be one of the following: PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public android.graphics.PointF[] getCalloutLinePoints() throws PDFException
PointF
objects array with 2 or 3 elements that
receives the points position. For 2 elements, the first one means
starting point and the second one means ending point.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float[] getInnerRectMargin() throws PDFException
For free text annotation, inner rectangle is where the annotation's text should be displayed. Usually, the sum of top and bottom margin values should be less than the height of annotation's rectangle, and the sum of left and right margin values should be less than the width of annotation's rectangle.
float
array that receives the margin values.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String[] getLineEndingStyles() throws PDFException
String
objects array with two elements that receive
values of line ending style property. The first element is the
value of starting style property, and the second element is the
value of ending style property. Please refer to constants
definitions
LINEENDINGSTYLE_XXX
and each of the two elements should be one of these constants. If
not found, all elements in array will be
null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Markup
public void setLineEndingStyle(java.lang.String startingStyle, java.lang.String endingStyle) throws PDFException
startingStyle
- A String
object that specifies value of starting
property. Please refer to constants definitions
LINEENDINGSTYLE_XXX
and this should be one of these constants.endingStyle
- A String
object that specifies value of ending
property. Please refer to constants definitions
LINEENDINGSTYLE_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Markup
public DefaultAppearance getDefaultAppearance() throws PDFException
DefaultAppearance
object that receives default
appearance of a free text annotation. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DefaultAppearance
public void setDefaultAppearance(DefaultAppearance defaultAppearance) throws PDFException
defaultAppearance
- A DefaultAppearance
object that specifies default
appearance.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DefaultAppearance
public void setFillColor(long color) throws PDFException
color
- A long
value that specifies value of fill
color. Format: 0xAARRGGBB, and alpha value is ignored.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setAlignment(int alignment) throws PDFException
alignment
- Alignment value to be set to the annotation. It should be one
of the followings: PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCalloutLinePoints(android.graphics.PointF pt1, android.graphics.PointF pt2, android.graphics.PointF pt3) throws PDFException
Callout line points property can have 2 or 3 points:
pt3
should be set the same value as
pt2
.pt1
- A PointF
object to specify the first
point position.pt2
- A PointF
object to specify the second
point position.pt3
- A PointF
object to specify the third
point position.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setInnerRectMargin(float[] values) throws PDFException
For free text annotation, inner rectangle is where the annotation's text should be displayed. When setting inner rectangle margin, application should ensure that: the sum of top and bottom margin values should be less than the height of annotation's rectangle, and the sum of left and right margin values should be less than the width of annotation's rectangle.
values
- A float
array with 4 elements to specify the new margin
values. The 4 elements should represent "left", "top", "right"
and "bottom" values in turn.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