java.lang.Object | |
↳ | com.pdftron.pdf.model.AnnotStyle |
This class contains annotation style information
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | AnnotStyle.AnnotStyleHolder | This interface is for holding annotation style | |||||||||
interface | AnnotStyle.OnAnnotStyleChangeListener | This interface is used for changing annotation appearance |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | CUSTOM_ADD_PAGE | The constant represents the add page button | |||||||||
int | CUSTOM_ANNOT_TYPE_AREA_MEASURE | The constant represents area annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_ARROW | The constant represents arrow annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_CALLOUT | The constant represents callout annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_CHECKBOX_FIELD | The constant represents the checkbox field annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_CHECKMARK_STAMP | The constant represents check mark stamp annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_CLOUD | The constant represents cloud annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_COMBO_BOX | The constant represents the combo box field annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_COUNT_MEASUREMENT | The constant represents the rectangle multi-select tool | |||||||||
int | CUSTOM_ANNOT_TYPE_CROSS_STAMP | The constant represents cross stamp annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_DOT_STAMP | The constant represents dot stamp annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_ERASER | The constant represents eraser annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_FREE_HIGHLIGHTER | The constant represents free highlighter annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_FREE_TEXT_DATE | The constant represents a date free text type | |||||||||
int | CUSTOM_ANNOT_TYPE_FREE_TEXT_SPACING | The constant represents stretchable free text type | |||||||||
int | CUSTOM_ANNOT_TYPE_IMAGE_STAMP | The constant represents image stamp annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_LASSO_MULTI_SELECT | The constant represents the lasso multi-select tool | |||||||||
int | CUSTOM_ANNOT_TYPE_LIST_BOX | The constant represents the list box field annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_PAN | The constant represents the pan tool | |||||||||
int | CUSTOM_ANNOT_TYPE_PERIMETER_MEASURE | The constant represents perimeter annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_RADIO_BUTTON | The constant represents the radio button field annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_RECT_AREA_MEASURE | The constant represents rectangular area annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_RECT_MULTI_SELECT | The constant represents the rectangle multi-select tool | |||||||||
int | CUSTOM_ANNOT_TYPE_RULER | The constant represents ruler annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_SIGNATURE | The constant represents signature annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_SIGNATURE_FIELD | The constant represents the signature field annotation type | |||||||||
int | CUSTOM_ANNOT_TYPE_TEXT_FIELD | The constant represents the text field annotation type | |||||||||
int | CUSTOM_EDIT_TOOLBAR | The constant represents the edit toolbar button | |||||||||
int | CUSTOM_PAGE_REDACTION | The constant represents the page redaction button | |||||||||
int | CUSTOM_RECT_REDACTION | The constant represents the area redaction tool | |||||||||
int | CUSTOM_SEARCH_REDACTION | The constant represents the search redaction button | |||||||||
int | CUSTOM_SMART_PEN | The constant represents the smart pen tool | |||||||||
int | CUSTOM_TOOL_REDO | The constant represents the redo button | |||||||||
int | CUSTOM_TOOL_UNDO | The constant represents the undo tool | |||||||||
String | KEY_PDFTRON_RULER | ||||||||||
String | KEY_RULER_BASE | ||||||||||
String | KEY_RULER_BASE_UNIT | ||||||||||
String | KEY_RULER_TRANSLATE | ||||||||||
String | KEY_RULER_TRANSLATE_UNIT |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnnotStyle()
Class constructor
| |||||||||||
AnnotStyle(AnnotStyle other)
Class constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
bindPreview(ActionButton previewView)
Bind a preview view to this annotation style, whenever the annotation style updates, the preview updates
| ||||||||||
void |
disableUpdateListener(boolean disable)
Disable update annotation change listener
| ||||||||||
boolean | equals(Object obj) | ||||||||||
int |
getAnnotType()
The overload implementation of
getToolMode() . | ||||||||||
ActionButton |
getBindedPreview()
Gets binded preview
| ||||||||||
double |
getBorderEffectIntensity()
Gets the border effect intensity
| ||||||||||
ShapeBorderStyle | getBorderStyle() | ||||||||||
int |
getColor()
Gets color of annotation style, for annotation style has border, it means stroke color
| ||||||||||
String | getDateFormat() | ||||||||||
Eraser.EraserType |
getEraserType()
Gets the eraser type
| ||||||||||
int |
getFillColor()
Gets fill color of annotation style
| ||||||||||
FontResource |
getFont()
Gets font for free text annotation
| ||||||||||
String |
getFontPath()
Gets font path of font.
| ||||||||||
int | getHorizontalAlignment() | ||||||||||
String |
getIcon()
Gets Icon for StickyNote
Text annotation | ||||||||||
static Drawable |
getIconDrawable(Context context, String icon, int color, float opacity)
Gets icon drawable based on icon name, opacity
| ||||||||||
Drawable |
getIconDrawable(Context context)
Gets icon drawable
| ||||||||||
static Drawable |
getIconDrawable(Context context, String iconOutline, String iconFill, int color, float opacity)
Gets icon drawable based on icon name, opacity
| ||||||||||
Eraser.InkEraserMode |
getInkEraserMode()
Gets the ink eraser mode
| ||||||||||
float | getLetterSpacing() | ||||||||||
LineEndingStyle | getLineEndStyle() | ||||||||||
LineEndingStyle | getLineStartStyle() | ||||||||||
LineStyle | getLineStyle() | ||||||||||
float |
getOpacity()
Gets opacity of annotation style
| ||||||||||
String |
getOverlayText()
Gets overlay text.
| ||||||||||
String |
getPDFTronFontName()
Gets PDFTron font name for free text annotation.
| ||||||||||
int | getPrecision() | ||||||||||
boolean |
getPressureSensitive()
Gets whether pressure sensitivity is used.
| ||||||||||
String |
getRulerBaseUnit()
Gets the ruler base unit
| ||||||||||
float |
getRulerBaseValue()
Gets the ruler base value
| ||||||||||
RulerItem |
getRulerItem()
Gets the ruler item
| ||||||||||
String |
getRulerTranslateUnit()
Gets the ruler translate unit
| ||||||||||
float |
getRulerTranslateValue()
Gets the ruler translate value
| ||||||||||
boolean |
getSnap()
Gets whether snap to points
| ||||||||||
String |
getStampId()
Gets the identifier of stamp or signature.
| ||||||||||
int |
getTextColor()
Gets text color of free text annotation style
| ||||||||||
String |
getTextContent()
Gets text content of free text annotation
| ||||||||||
String | getTextHTMLContent() | ||||||||||
float |
getTextSize()
Gets text size of free text annotation style
| ||||||||||
float |
getThickness()
Gets stroke thickness of annotation style
| ||||||||||
int | getVerticalAlignment() | ||||||||||
boolean | hasBorderStyle() | ||||||||||
boolean | hasBorderStyleWithoutCloud() | ||||||||||
boolean |
hasColor()
Whether annotation style has color
| ||||||||||
boolean |
hasFillColor()
Whether annotation style has fill color
| ||||||||||
boolean |
hasFont()
Whether annotation style should have font.
| ||||||||||
boolean |
hasIcon()
Whether annotation style has icon
| ||||||||||
boolean | hasLineEndStyle() | ||||||||||
boolean | hasLineStartStyle() | ||||||||||
boolean | hasLineStyle() | ||||||||||
boolean |
hasOpacity()
Whether annotation style has opacity
| ||||||||||
boolean |
hasPressureSensitivity()
Whether annotation style should have pressure sensitivity setting.
| ||||||||||
boolean |
hasStampId()
Whether annotation style should have stamp id
| ||||||||||
boolean |
hasTextAlignment()
Whether annotation style should have text alignment options
| ||||||||||
boolean |
hasTextStyle()
Whether annotation style should have text style (i.e.
| ||||||||||
boolean |
hasThickness()
Whether annotation style has border thickness
| ||||||||||
int | hashCode() | ||||||||||
boolean |
isBasicFreeText()
Whether annotation style is freetext annotation but not callout or contains rich content
| ||||||||||
boolean |
isCallout()
Whether annotation style is callout annotation
| ||||||||||
boolean |
isCountMeasurement()
Whether annotation style is count measurement
| ||||||||||
boolean |
isDateFreeText()
Whether annotation style is free text with date
| ||||||||||
boolean | isEnabled() | ||||||||||
boolean |
isEraser()
Whether style is eraser
| ||||||||||
boolean |
isFreeText()
Whether annotation style is freetext annotation
| ||||||||||
static boolean |
isFreeTextGroup(int annotType)
Whether annotation type is any variant of FreeText
| ||||||||||
boolean |
isFreeTextGroup()
Whether annotation style base is FreeText
This can mean any variation of FreeText
| ||||||||||
boolean |
isLine()
Whether annotation style is line annotation
| ||||||||||
boolean |
isMeasurement()
Whether annotation style is measurement annotation
| ||||||||||
boolean |
isRCFreeText()
Whether annotation style is free text with rich content
| ||||||||||
boolean |
isRedaction()
Whether annotation style is redaction
| ||||||||||
boolean |
isRubberStamp()
Whether annotation style is rubber stamp annotation
| ||||||||||
boolean |
isRuler()
Whether annotation style is ruler
| ||||||||||
boolean |
isSignature()
Whether annotation style is signature annotation
| ||||||||||
boolean |
isSound()
Whether annotation style is sound
| ||||||||||
boolean |
isSpacingFreeText()
Whether annotation style is free text with spacing
| ||||||||||
boolean |
isSquare()
Whether annotation style is square annotation
| ||||||||||
boolean |
isStickyNote()
Whether annotation style is sticky note
| ||||||||||
boolean |
isWatermark()
Whether annotation style is watermark
| ||||||||||
boolean |
isWidget()
Whether annotation style is Widget annotation
| ||||||||||
static AnnotStyle |
loadJSONString(Context context, String jsonStr, int annotType)
Convert JSON String to annotation style
| ||||||||||
static AnnotStyle |
loadJSONString(String jsonStr)
Convert JSON String to annotation style
| ||||||||||
void |
setAnnotAppearanceChangeListener(AnnotStyle.OnAnnotStyleChangeListener listener)
Sets annotation style change listener
| ||||||||||
void |
setAnnotType(int annotType)
Sets annotation type, can be obtained from
getType() | ||||||||||
void |
setBorderEffectIntensity(double intensity)
Sets the border effect intensity
| ||||||||||
void |
setBorderStyle(ShapeBorderStyle borderStyle)
Sets border style.
| ||||||||||
void | setDateFormat(String format) | ||||||||||
void | setEnabled(boolean enabled) | ||||||||||
void |
setEraserType(Eraser.EraserType type)
Sets eraser type
| ||||||||||
void |
setFillColor(int fillColor)
Sets fill color.
| ||||||||||
void |
setFont(FontResource font)
Sets font for
FreeText annotation. | ||||||||||
void | setHorizontalAlignment(int alignment) | ||||||||||
void |
setIcon(String icon)
Sets icon for
Text annotation. | ||||||||||
void |
setInkEraserMode(Eraser.InkEraserMode mode)
Sets the ink eraser mode
| ||||||||||
void | setLetterSpacing(float spacing) | ||||||||||
void |
setLineEndStyle(LineEndingStyle lineEndStyle)
Sets line ending style.
| ||||||||||
void |
setLineStartStyle(LineEndingStyle lineStartStyle)
Sets line start style.
| ||||||||||
void |
setLineStyle(LineStyle lineStyle)
Sets line style.
| ||||||||||
void |
setOpacity(float opacity)
Sets opacity for
Markup annotation. | ||||||||||
void |
setOpacity(float opacity, boolean done)
Sets opacity for
Markup annotation. | ||||||||||
void |
setOverlayText(String text)
Sets overlay text.
| ||||||||||
void |
setPressureSensitivity(boolean hasPressure)
Sets whether pressure sensitivity is enabled.
| ||||||||||
void |
setRulerBaseUnit(String unit)
Sets ruler base unit
| ||||||||||
void |
setRulerBaseValue(float value)
Sets ruler base value
| ||||||||||
void |
setRulerItem(RulerItem ruler)
Sets ruler properties
| ||||||||||
void | setRulerPrecision(int precision) | ||||||||||
void |
setRulerTranslateUnit(String unit)
Sets ruler translate unit
| ||||||||||
void |
setRulerTranslateValue(float value)
Sets ruler translate value
| ||||||||||
void |
setSnap(boolean snap)
Sets snap.
| ||||||||||
void |
setStampId(String stampId)
Sets the identifier of stamp or signature.
| ||||||||||
void |
setStrokeColor(int strokeColor)
Sets stroke color.
| ||||||||||
void |
setStyle(AnnotStyle other)
Copy other annotation style
| ||||||||||
void |
setStyle(int strokeColor, int fillColor, float thickness, float opacity)
Sets annotation style
| ||||||||||
void | setTextColor(int textColor) | ||||||||||
void |
setTextContent(String content)
Sets content of
FreeText annotation. | ||||||||||
void | setTextHTMLContent(String html) | ||||||||||
void |
setTextSize(float textSize, boolean done)
Sets text size for
FreeText annotation. | ||||||||||
void |
setTextSize(float textSize)
Sets text size for
FreeText annotation. | ||||||||||
void |
setThickness(float thickness)
Sets stroke thickness.
| ||||||||||
void |
setThickness(float thickness, boolean done)
Sets stroke thickness.
| ||||||||||
void | setVerticalAlignment(int alignment) | ||||||||||
String |
toJSONString()
Convert annotation style to string in json format
| ||||||||||
String | toString() | ||||||||||
void | updateAllListeners() | ||||||||||
void | updateBorderStyleListener(ShapeBorderStyle borderStyle, boolean update) | ||||||||||
void | updateLineEndStyleListener(LineEndingStyle lineEndStyle, boolean update) | ||||||||||
void | updateLineStartStyleListener(LineEndingStyle lineStartStyle, boolean update) | ||||||||||
void | updateLineStyleListener(LineStyle lineStyle, boolean update) | ||||||||||
void | updateTextAlignment(int horizontalAlignment, int verticalAlignment, boolean update) | ||||||||||
void |
updateTextSizeListener(float textSize, boolean update, boolean done)
Update text size to listener
| ||||||||||
void |
updateThicknessListener(float thickness, boolean update, boolean done)
Update thickness to listener
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The constant represents the add page button
The constant represents area annotation type
The constant represents arrow annotation type
The constant represents callout annotation type
The constant represents the checkbox field annotation type
The constant represents check mark stamp annotation type
The constant represents cloud annotation type
The constant represents the combo box field annotation type
The constant represents the rectangle multi-select tool
The constant represents cross stamp annotation type
The constant represents dot stamp annotation type
The constant represents eraser annotation type
The constant represents free highlighter annotation type
The constant represents a date free text type
The constant represents stretchable free text type
The constant represents image stamp annotation type
The constant represents the lasso multi-select tool
The constant represents the list box field annotation type
The constant represents the pan tool
The constant represents perimeter annotation type
The constant represents the radio button field annotation type
The constant represents rectangular area annotation type
The constant represents the rectangle multi-select tool
The constant represents ruler annotation type
The constant represents signature annotation type
The constant represents the signature field annotation type
The constant represents the text field annotation type
The constant represents the edit toolbar button
The constant represents the page redaction button
The constant represents the area redaction tool
The constant represents the search redaction button
The constant represents the smart pen tool
The constant represents the redo button
The constant represents the undo tool
Class constructor
Class constructor
other | other annotation style to copy from |
---|
Bind a preview view to this annotation style, whenever the annotation style updates, the preview updates
previewView | preview view |
---|
Disable update annotation change listener
disable | true then disable, false otherwise |
---|
Gets the border effect intensity
Gets color of annotation style, for annotation style has border, it means stroke color
Gets fill color of annotation style
Gets font path of font.
This is equivalent to calling annotStyle.getFont().getFontPath();
Gets icon drawable based on icon name, opacity
context | The context to get resources |
---|---|
icon | icon name |
opacity | opacity of icon. from [0, 1] |
Gets icon drawable
context | The context to get resource |
---|
Gets icon drawable based on icon name, opacity
context | The context to get resources |
---|---|
iconOutline | name of icon outline |
iconFill | name of icon fill |
opacity | opacity of icon. from [0, 1] |
Gets the ink eraser mode
Gets opacity of annotation style
Gets PDFTron font name for free text annotation.
This is equivalent to calling annotStyle.getFont().getPDFTronName();
Gets whether pressure sensitivity is used.
Gets the ruler base unit
Gets the ruler base value
Gets the ruler translate unit
Gets the ruler translate value
Gets whether snap to points
Gets the identifier of stamp or signature.
Gets text color of free text annotation style
Gets text content of free text annotation
Gets text size of free text annotation style
Gets stroke thickness of annotation style
Whether annotation style has color
Whether annotation style has fill color
Whether annotation style should have font.
Whether annotation style has icon
Whether annotation style has opacity
Whether annotation style should have pressure sensitivity setting.
Whether annotation style should have stamp id
Whether annotation style should have text alignment options
Whether annotation style should have text style (i.e. text color and text size).
Whether annotation style has border thickness
Whether annotation style is freetext annotation but not callout or contains rich content
Whether annotation style is callout annotation
Whether annotation style is count measurement
Whether annotation style is free text with date
Whether style is eraser
Whether annotation style is freetext annotation
Whether annotation type is any variant of FreeText
annotType | the annotation type |
---|
Whether annotation style base is FreeText This can mean any variation of FreeText
Whether annotation style is line annotation
Whether annotation style is measurement annotation
Whether annotation style is free text with rich content
Whether annotation style is redaction
Whether annotation style is rubber stamp annotation
Whether annotation style is ruler
Whether annotation style is signature annotation
Whether annotation style is sound
Whether annotation style is free text with spacing
Whether annotation style is square annotation
Whether annotation style is sticky note
Whether annotation style is watermark
Whether annotation style is Widget annotation
Convert JSON String to annotation style
context | the context |
---|---|
jsonStr | json string |
annotType | annotation type |
Convert JSON String to annotation style
jsonStr | json string |
---|
Sets annotation style change listener
listener | annotation style change listener |
---|
Sets annotation type, can be obtained from getType()
annotType | annotation type |
---|
Sets the border effect intensity
intensity | border effect intensity |
---|
Sets border style.
borderStyle | border style |
---|
Sets fill color.
For Markup
annotation, fill color can be obtained from getInteriorColor()
;
For FreeText
annotation, fill color can be obtained from getColorAsRGB()
fillColor | fill color |
---|
Sets font for FreeText
annotation.
Font can be obtained from calling
Obj freeTextObj = freeText.getSDFObj();
Obj drDict = freeTextObj.findObj("DR");
if (drDict != null && drDict.isDict()) {
Obj fontDict = drDict.findObj("Font");
if (fontDict != null && fontDict.isDict()) {
DictIterator fItr = fontDict.getDictIterator();
if (fItr.hasNext()) {
Font f = new Font(fItr.value());
String fontName = f.getName();
FontResource font = new FontResource(fontName);
}
}
}
font | font |
---|
Sets icon for Text
annotation.
Icon can be obtained from getIconName()
icon | icon |
---|
Sets the ink eraser mode
mode | the eraser mode |
---|
Sets line ending style.
lineEndStyle | line ending style |
---|
Sets line start style.
lineStartStyle | line start style |
---|
Sets opacity for Markup
annotation.
Opacity can be obtained from getOpacity()
opacity | opacity |
---|
Sets opacity for Markup
annotation.
Opacity can be obtained from getOpacity()
opacity | opacity |
---|---|
done | done sliding |
Sets whether pressure sensitivity is enabled.
hasPressure | whether to enable pressure sensitivity. |
---|
Sets ruler base unit
unit | the unit |
---|
Sets ruler base value
value | the value |
---|
Sets ruler translate unit
unit | the unit |
---|
Sets ruler translate value
value | the value |
---|
Sets snap.
snap | whether to snap to points |
---|
Sets the identifier of stamp or signature.
stampId | the unique identifier |
---|
Sets stroke color.
For normal annotation, stroke color can be obtained from getColorAsRGB()
;
For FreeText
annotation, stroke color can be obtained from getLineColor()
strokeColor | stroke color |
---|
Copy other annotation style
other | other annotation style |
---|
Sets annotation style
strokeColor | stroke color |
---|---|
fillColor | fill color |
thickness | stroke thickness |
opacity | opacity |
Sets text color for FreeText
and Widget
annotations.
text color can be obtained from getTextColor()
or
getTextColor()
textColor | text color |
---|
Sets content of FreeText
annotation.
content | content |
---|
Sets text size for FreeText
annotation.
text size can be obtained from getFontSize()
textSize | text size |
---|---|
done | done sliding |
Sets text size for FreeText
annotation.
text size can be obtained from getFontSize()
textSize | text size |
---|
Sets stroke thickness.
Annotation stroke thickness can be obtained from getWidth()
thickness | border style thickness |
---|
Sets stroke thickness.
Annotation stroke thickness can be obtained from getWidth()
thickness | border style thickness |
---|---|
done | done sliding |
Convert annotation style to string in json format
Update text size to listener
textSize | textSize |
---|---|
update | whether to invoke listener method |
Update thickness to listener
thickness | thickness |
---|---|
update | whether to invoke listener method |