public class Annot
extends java.lang.Object
Annot
represents the base class of the PDF annotation.
It offers almost the common properties get and set methods for all supported
annotations.
Before call all methods in this class,
please note to call
at first.PDFPage.loadAnnots()
PDFPage
Modifier and Type | Class and Description |
---|---|
static class |
Annot.Border
Border is an inner class defined for the annotation border. |
static class |
Annot.QuadpointsF
QuadpointsF is an inner class defined for a PDF quadrilaterals point. |
Modifier and Type | Field and Description |
---|---|
static int |
BORDERSTYLE_BEVELED
Border style: Beveled
|
static int |
BORDERSTYLE_CLOUDY
Border style: Cloudy
|
static int |
BORDERSTYLE_DASHED
Border style: Dashed
|
static int |
BORDERSTYLE_INSET
Border style: Inset
|
static int |
BORDERSTYLE_SOLID
Border style: Solid
|
static int |
BORDERSTYLE_UNDERLINE
Border style: Underline
|
static int |
FLAG_HIDDEN
Annotation flag: hidden
|
static int |
FLAG_INVISIBLE
Annotation flag: invisible
|
static int |
FLAG_LOCKED
Annotation flag: locked
|
static int |
FLAG_LOCKEDCONTENTS
Annotation flag: locked contents
|
static int |
FLAG_NOROTATE
Annotation flag: no rotate
|
static int |
FLAG_NOVIEW
Annotation flag: no view
|
static int |
FLAG_NOZOOM
Annotation flag: no zoom
|
static int |
FLAG_PRINT
Annotation flag: print
|
static int |
FLAG_READONLY
Annotation flag: read only
|
static int |
FLAG_TOGGLENOVIEW
Annotation flag: toggle no view
|
static int |
HIGHLIGHTINGMODE_INVERT
Highlighting mode: Invert
|
static int |
HIGHLIGHTINGMODE_NONE
Highlighting mode: None
|
static int |
HIGHLIGHTINGMODE_OUTLINE
Highlighting mode: Outline
|
static int |
HIGHLIGHTINGMODE_PUSH
Highlighting mode: Push
|
static int |
HIGHLIGHTINGMODE_TOGGLE
Highlighting mode: Toggle
It only supports widget annotation.
|
static int |
MKENTRY_BACKGROUNDCOLOR
Entry of appearance characteristics dictionary: BG.
|
static int |
MKENTRY_BORDERCOLOR
Entry of appearance characteristics dictionary: BC.
|
static int |
MKENTRY_DOWNCAPTION
Entry of appearance characteristics dictionary: AC, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_DOWNICON
Entry of appearance characteristics dictionary: IX, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_ICONFIT
Entry of appearance characteristics dictionary: IF, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_NORMALCAPTION
Entry of appearance characteristics dictionary: CA, only for widget
annotation with any button fields.
|
static int |
MKENTRY_NORMALICON
Entry of appearance characteristics dictionary: I, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_ROLLOVERCAPTION
Entry of appearance characteristics dictionary: RC, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_ROLLOVERICON
Entry of appearance characteristics dictionary: RI, only for widget
annotation with pushbutton fields.
|
static int |
MKENTRY_ROTATION
Entry of appearance characteristics dictionary: R.
|
static int |
MKENTRY_TEXTPOSITION
Entry of appearance characteristics dictionary: TP, only for widget
annotation with pushbutton fields.
|
static int |
TRIGGER_ANNOT_CE
An action to be performed when the cursor enters the annotation's active
area.
|
static int |
TRIGGER_ANNOT_CX
An action to be performed when the cursor exits the annotation's active
area.
|
static int |
TRIGGER_ANNOT_FL
An action to be performed when the annotation loses the focus.
|
static int |
TRIGGER_ANNOT_FO
An action to be performed when the annotation receives the focus.
|
static int |
TRIGGER_ANNOT_MD
An action to be performed when the mouse button is pressed inside the
annotation's active area.
|
static int |
TRIGGER_ANNOT_MU
An action to be performed when the mouse button is released inside the
annotation's active area.
|
static int |
TRIGGER_ANNOT_PC
An action to be performed when the page containing the annotation is
closed.
|
static int |
TRIGGER_ANNOT_PI
An action to be performed when the page containing the annotation is no
longer visible in the viewer application's user interface.
|
static int |
TRIGGER_ANNOT_PO
An action to be performed when the page containing the annotation is
opened.
|
static int |
TRIGGER_ANNOT_PV
An action to be performed when the page containing the annotation becomes
visible in the viewer application's user interface.
|
static java.lang.String |
TYPE_3D
3D annotation.
|
static java.lang.String |
TYPE_CARET
Caret annotation, markup type.
|
static java.lang.String |
TYPE_CIRCLE
Circle annotation, markup type.
|
static java.lang.String |
TYPE_FILEATTACHMENT
File attachment annotation, markup type.
|
static java.lang.String |
TYPE_FREETEXT
Free text annotation, markup type.
|
static java.lang.String |
TYPE_HIGHLIGHT
Highlight annotation, markup type.
|
static java.lang.String |
TYPE_INK
Ink annotation, markup type.
|
static java.lang.String |
TYPE_LINE
Line annotation, markup type.
|
static java.lang.String |
TYPE_LINK
Link annotation.
|
static java.lang.String |
TYPE_MOVIE
Movie annotation.
|
static java.lang.String |
TYPE_POLYGON
Polygon annotation, markup type.
|
static java.lang.String |
TYPE_POLYLINE
Polyline annotation, markup type.
|
static java.lang.String |
TYPE_POPUP
Pop-up annotation.
|
static java.lang.String |
TYPE_PRINTERMARK
Printer's mark annotation.
|
static java.lang.String |
TYPE_PSI
Pressure sensitive Ink annotation.
|
static java.lang.String |
TYPE_SCREEN
Screen annotation.
|
static java.lang.String |
TYPE_SOUND
Sound annotation, markup type.
|
static java.lang.String |
TYPE_SQUARE
Square annotation, markup type.
|
static java.lang.String |
TYPE_SQUIGGLY
Squiggly-underline annotation, markup type.
|
static java.lang.String |
TYPE_STAMP
Rubber stamp annotation, markup type.
|
static java.lang.String |
TYPE_STRIKEOUT
Strikeout annotation, markup type.
|
static java.lang.String |
TYPE_TEXT
Text annotation, markup type.
|
static java.lang.String |
TYPE_TRAPNET
Trap network annotation.
|
static java.lang.String |
TYPE_UNDERLINE
Underline annotation, markup type.
|
static java.lang.String |
TYPE_WATERMARK
Watermark annotation.
|
static java.lang.String |
TYPE_WIDGET
Widget annotation.
|
Modifier and Type | Method and Description |
---|---|
Annot.Border |
getBorder()
Get border of current PDF annotation.
|
long |
getBorderColor()
Get border color of current PDF annotation.
|
java.lang.String |
getContents()
Get contents of current PDF annotation.
|
android.graphics.Rect |
getDeviceRect(boolean bTransformIcon,
android.graphics.Matrix matrix)
Get the rectangle of current PDF annotation in device coordinations.
|
int |
getFlags()
Get current PDF annotation flags.
|
long |
getHandle()
Get the handle of
Annot object. |
int |
getIndex(java.lang.String filter)
Get the index of current PDF annotation, by specific filter.
|
DateTime |
getModifiedDateTime()
Get modification time of current PDF annotation.
|
java.lang.String |
getName()
Get name property of current PDF annotation.
|
android.graphics.RectF |
getRect()
Get the rectangle of current PDF annotation in PDF page coordinations.
|
java.lang.String |
getType()
Get the type of current PDF annotation.
|
boolean |
isMarkup()
Checks whether current PDF annotation is a
Markup
annotation. |
void |
move(android.graphics.RectF newRect)
Move current pdf annotation to a new position specified by a rectangle.
|
void |
setBorder(Annot.Border border)
Set border of current PDF annotation.
|
void |
setBorderColor(long color)
Set border color of current PDF annotation.
|
void |
setContents(java.lang.String contents)
Set contents of current PDF annotation.
|
void |
setFlags(int flags)
Set current PDF annotation flags.
|
static void |
setIconProvider(AnnotIconProvider iconProvider)
Set handler of PDF annotation icon provider to SDK management.
|
void |
setModifiedDateTime(DateTime dateTime)
Set modification time of current PDF annotation.
|
void |
setName(java.lang.String name)
Set name value of current PDF annotation.
|
public static final java.lang.String TYPE_TEXT
public static final java.lang.String TYPE_LINK
public static final java.lang.String TYPE_FREETEXT
public static final java.lang.String TYPE_LINE
public static final java.lang.String TYPE_SQUARE
public static final java.lang.String TYPE_CIRCLE
public static final java.lang.String TYPE_POLYGON
public static final java.lang.String TYPE_POLYLINE
public static final java.lang.String TYPE_HIGHLIGHT
public static final java.lang.String TYPE_UNDERLINE
public static final java.lang.String TYPE_SQUIGGLY
public static final java.lang.String TYPE_STRIKEOUT
public static final java.lang.String TYPE_STAMP
public static final java.lang.String TYPE_CARET
public static final java.lang.String TYPE_INK
public static final java.lang.String TYPE_POPUP
public static final java.lang.String TYPE_FILEATTACHMENT
public static final java.lang.String TYPE_SOUND
public static final java.lang.String TYPE_MOVIE
public static final java.lang.String TYPE_WIDGET
com.foxit.gsdk.pdf.form
package.public static final java.lang.String TYPE_SCREEN
public static final java.lang.String TYPE_PRINTERMARK
public static final java.lang.String TYPE_TRAPNET
public static final java.lang.String TYPE_WATERMARK
public static final java.lang.String TYPE_PSI
com.foxit.gsdk.psi
package.public static final java.lang.String TYPE_3D
public static final int FLAG_INVISIBLE
public static final int FLAG_HIDDEN
public static final int FLAG_PRINT
public static final int FLAG_NOZOOM
public static final int FLAG_NOROTATE
public static final int FLAG_NOVIEW
public static final int FLAG_READONLY
public static final int FLAG_LOCKED
public static final int FLAG_TOGGLENOVIEW
public static final int FLAG_LOCKEDCONTENTS
public static final int BORDERSTYLE_SOLID
public static final int BORDERSTYLE_DASHED
public static final int BORDERSTYLE_UNDERLINE
public static final int BORDERSTYLE_BEVELED
public static final int BORDERSTYLE_INSET
public static final int BORDERSTYLE_CLOUDY
public static final int HIGHLIGHTINGMODE_NONE
public static final int HIGHLIGHTINGMODE_INVERT
public static final int HIGHLIGHTINGMODE_OUTLINE
public static final int HIGHLIGHTINGMODE_PUSH
public static final int HIGHLIGHTINGMODE_TOGGLE
public static final int MKENTRY_ROTATION
public static final int MKENTRY_BORDERCOLOR
public static final int MKENTRY_BACKGROUNDCOLOR
public static final int MKENTRY_NORMALCAPTION
public static final int MKENTRY_ROLLOVERCAPTION
public static final int MKENTRY_DOWNCAPTION
public static final int MKENTRY_NORMALICON
public static final int MKENTRY_ROLLOVERICON
public static final int MKENTRY_DOWNICON
public static final int MKENTRY_ICONFIT
public static final int MKENTRY_TEXTPOSITION
public static final int TRIGGER_ANNOT_CE
public static final int TRIGGER_ANNOT_CX
public static final int TRIGGER_ANNOT_MD
public static final int TRIGGER_ANNOT_MU
public static final int TRIGGER_ANNOT_FO
public static final int TRIGGER_ANNOT_FL
public static final int TRIGGER_ANNOT_PO
public static final int TRIGGER_ANNOT_PC
public static final int TRIGGER_ANNOT_PV
public static final int TRIGGER_ANNOT_PI
public long getHandle()
Annot
object.Annot
object handle.public boolean isMarkup() throws PDFException
Markup
annotation.boolean
value that indicates whether current PDF
annotation is Markup
or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Markup
,
TextMarkup
public int getIndex(java.lang.String filter) throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
filter
- A filter string. If it's null
, this function will
count all annotations. If it's a valid string, it specifies
annotation type:TYPE_XXX
and
it should be one of these constants. PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getType() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
String
object that receives the type of current
PDF annotation. Please refer to constants definitions
TYPE_XXX
and this should be one of
these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public android.graphics.RectF getRect() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
RectF
object that receives rectangle of current
PDF Annotation.RectF
will be [0 0 0 0].PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public android.graphics.Rect getDeviceRect(boolean bTransformIcon, android.graphics.Matrix matrix) throws PDFException
This is a useful function to get the device rectangle of current PDF
Annotation.
For the rectangle conversion, the result rectangle is always "normalized"
in device coordinations, which means: left is always smaller than right,
and top is always smaller than bottom.
bTransformIcon
- A boolean
value which indicates that whether to
transform (like rotate or scale) the icon with page:
true
means to transform icon's rectangle with
page, while false
means not to transform icon's
rectangle with page.matrix
- A Matrix
object used to transform from PDF page
coordinate system to device coordinate system.Rect
object that receives rectangle of an
annotation in device coordinations.Rect
will be [0 0 0 0].PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Popup
public int getFlags() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
integer
value that receives current PDF
annotation flags. Please refer to
FLAG_XXX
and this can be one
or a combination of these definitions.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getName() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
String
object that receives value of name
property.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getContents() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
String
object that receives the value of contents property.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Annot.Border getBorder() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
Border
object that receives border information.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Annot.Border
public long getBorderColor() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
long
value that receives value of border color
property.Format: 0xAARRGGBB, and alpha value is ignored.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public DateTime getModifiedDateTime() throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
DateTime
object that receives the value of
modification time property.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime
public void setFlags(int flags) throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
flags
- The flags to be set to the annotation. Please refer to
constants definitions FLAG_XXX
and this can be one or a combination of these
constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void move(android.graphics.RectF newRect) throws PDFException
To move an annotation is to reset its rectangle.
newRect
- A RectF
object that specifies the new position.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setName(java.lang.String name) throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
name
- A String
object that specifies value of name
property. It can be null
or empty.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setContents(java.lang.String contents) throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
contents
- A String
object that specifies value of contents
property. It can be null
or empty.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setBorder(Annot.Border border) throws PDFException
This function can support all types defined in constants definitions
. The dash pattern array's
elements of TYPE_XXX
Border
object must be nonnegative and not all
zeros.
border
- A Border
object to specify border information.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Annot.Border
public void setBorderColor(long color) throws PDFException
This function can support all types defined in constants definitions
. Note: For FreeText
annotation, user could not get the correct value by function
TYPE_XXX
until
getBorderColor()
is called.FreeText.resetAppearance()
color
- A long
value that specifies value of border
color.Format: 0xAARRGGBB, and alpha value is ignored.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
FreeText
public void setModifiedDateTime(DateTime dateTime) throws PDFException
This function can support all types defined in constants definitions
.TYPE_XXX
dateTime
- A DateTime
object that specifies value of
modification time property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime
public static void setIconProvider(AnnotIconProvider iconProvider) throws PDFException
Icon provider can only be used for text, file attachment, stamp,
sound(not support now) PDF annotations. For annotation type "Text",
"FileAttachment", "Sound"(not support now) and "Stamp", they appear on
the page in some distinctive icons.
For annotation with type "Text" and "FileAttachment", Foxit PDF SDK has
defined their default icon appearance.
For stamp annotation, Foxit PDF SDK doesn't define default icon
appearance currently.
If you want to use private application icon appearance, this function
should be called to set an icon provider.
iconProvider
- An AnnotIconProvider
object that specifies the
handler of icon provider.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
AnnotIconProvider