public class

AnnotStyle

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.model.AnnotStyle

Class Overview

This class contains annotation style information

Summary

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)
Sets text color for FreeText and Widget annotations.
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

Constants

public static final int CUSTOM_ADD_PAGE

The constant represents the add page button

Constant Value: 1031 (0x00000407)

public static final int CUSTOM_ANNOT_TYPE_AREA_MEASURE

The constant represents area annotation type

Constant Value: 1009 (0x000003f1)

public static final int CUSTOM_ANNOT_TYPE_ARROW

The constant represents arrow annotation type

Constant Value: 1001 (0x000003e9)

public static final int CUSTOM_ANNOT_TYPE_CALLOUT

The constant represents callout annotation type

Constant Value: 1007 (0x000003ef)

public static final int CUSTOM_ANNOT_TYPE_CHECKBOX_FIELD

The constant represents the checkbox field annotation type

Constant Value: 1017 (0x000003f9)

public static final int CUSTOM_ANNOT_TYPE_CHECKMARK_STAMP

The constant represents check mark stamp annotation type

Constant Value: 1014 (0x000003f6)

public static final int CUSTOM_ANNOT_TYPE_CLOUD

The constant represents cloud annotation type

Constant Value: 1005 (0x000003ed)

public static final int CUSTOM_ANNOT_TYPE_COMBO_BOX

The constant represents the combo box field annotation type

Constant Value: 1018 (0x000003fa)

public static final int CUSTOM_ANNOT_TYPE_COUNT_MEASUREMENT

The constant represents the rectangle multi-select tool

Constant Value: 1034 (0x0000040a)

public static final int CUSTOM_ANNOT_TYPE_CROSS_STAMP

The constant represents cross stamp annotation type

Constant Value: 1015 (0x000003f7)

public static final int CUSTOM_ANNOT_TYPE_DOT_STAMP

The constant represents dot stamp annotation type

Constant Value: 1016 (0x000003f8)

public static final int CUSTOM_ANNOT_TYPE_ERASER

The constant represents eraser annotation type

Constant Value: 1003 (0x000003eb)

public static final int CUSTOM_ANNOT_TYPE_FREE_HIGHLIGHTER

The constant represents free highlighter annotation type

Constant Value: 1004 (0x000003ec)

public static final int CUSTOM_ANNOT_TYPE_FREE_TEXT_DATE

The constant represents a date free text type

Constant Value: 1011 (0x000003f3)

public static final int CUSTOM_ANNOT_TYPE_FREE_TEXT_SPACING

The constant represents stretchable free text type

Constant Value: 1010 (0x000003f2)

public static final int CUSTOM_ANNOT_TYPE_IMAGE_STAMP

The constant represents image stamp annotation type

Constant Value: 1013 (0x000003f5)

public static final int CUSTOM_ANNOT_TYPE_LASSO_MULTI_SELECT

The constant represents the lasso multi-select tool

Constant Value: 1025 (0x00000401)

public static final int CUSTOM_ANNOT_TYPE_LIST_BOX

The constant represents the list box field annotation type

Constant Value: 1021 (0x000003fd)

public static final int CUSTOM_ANNOT_TYPE_PAN

The constant represents the pan tool

Constant Value: 1023 (0x000003ff)

public static final int CUSTOM_ANNOT_TYPE_PERIMETER_MEASURE

The constant represents perimeter annotation type

Constant Value: 1008 (0x000003f0)

public static final int CUSTOM_ANNOT_TYPE_RADIO_BUTTON

The constant represents the radio button field annotation type

Constant Value: 1019 (0x000003fb)

public static final int CUSTOM_ANNOT_TYPE_RECT_AREA_MEASURE

The constant represents rectangular area annotation type

Constant Value: 1012 (0x000003f4)

public static final int CUSTOM_ANNOT_TYPE_RECT_MULTI_SELECT

The constant represents the rectangle multi-select tool

Constant Value: 1024 (0x00000400)

public static final int CUSTOM_ANNOT_TYPE_RULER

The constant represents ruler annotation type

Constant Value: 1006 (0x000003ee)

public static final int CUSTOM_ANNOT_TYPE_SIGNATURE

The constant represents signature annotation type

Constant Value: 1002 (0x000003ea)

public static final int CUSTOM_ANNOT_TYPE_SIGNATURE_FIELD

The constant represents the signature field annotation type

Constant Value: 1022 (0x000003fe)

public static final int CUSTOM_ANNOT_TYPE_TEXT_FIELD

The constant represents the text field annotation type

Constant Value: 1020 (0x000003fc)

public static final int CUSTOM_EDIT_TOOLBAR

The constant represents the edit toolbar button

Constant Value: 1028 (0x00000404)

public static final int CUSTOM_PAGE_REDACTION

The constant represents the page redaction button

Constant Value: 1032 (0x00000408)

public static final int CUSTOM_RECT_REDACTION

The constant represents the area redaction tool

Constant Value: 1029 (0x00000405)

public static final int CUSTOM_SEARCH_REDACTION

The constant represents the search redaction button

Constant Value: 1033 (0x00000409)

public static final int CUSTOM_SMART_PEN

The constant represents the smart pen tool

Constant Value: 1030 (0x00000406)

public static final int CUSTOM_TOOL_REDO

The constant represents the redo button

Constant Value: 1027 (0x00000403)

public static final int CUSTOM_TOOL_UNDO

The constant represents the undo tool

Constant Value: 1026 (0x00000402)

public static final String KEY_PDFTRON_RULER

Constant Value: "pdftronRuler"

public static final String KEY_RULER_BASE

Constant Value: "rulerBase"

public static final String KEY_RULER_BASE_UNIT

Constant Value: "rulerBaseUnit"

public static final String KEY_RULER_TRANSLATE

Constant Value: "rulerTranslate"

public static final String KEY_RULER_TRANSLATE_UNIT

Constant Value: "rulerTranslateUnit"

Public Constructors

public AnnotStyle ()

Class constructor

public AnnotStyle (AnnotStyle other)

Class constructor

Parameters
other other annotation style to copy from

Public Methods

public void bindPreview (ActionButton previewView)

Bind a preview view to this annotation style, whenever the annotation style updates, the preview updates

Parameters
previewView preview view

public void disableUpdateListener (boolean disable)

Disable update annotation change listener

Parameters
disable true then disable, false otherwise

public boolean equals (Object obj)

public int getAnnotType ()

The overload implementation of getToolMode().

public ActionButton getBindedPreview ()

Gets binded preview

Returns
  • binded preview

public double getBorderEffectIntensity ()

Gets the border effect intensity

Returns
  • border effect intensity

public ShapeBorderStyle getBorderStyle ()

public int getColor ()

Gets color of annotation style, for annotation style has border, it means stroke color

Returns
  • color

public String getDateFormat ()

public Eraser.EraserType getEraserType ()

Gets the eraser type

Returns
  • the eraser type

public int getFillColor ()

Gets fill color of annotation style

Returns
  • fill color

public FontResource getFont ()

Gets font for free text annotation

Returns
  • font resource

public String getFontPath ()

Gets font path of font. This is equivalent to calling annotStyle.getFont().getFontPath();

Returns
  • font path

public int getHorizontalAlignment ()

public String getIcon ()

Gets Icon for StickyNote Text annotation

Returns
  • icon name

public static Drawable getIconDrawable (Context context, String icon, int color, float opacity)

Gets icon drawable based on icon name, opacity

Parameters
context The context to get resources
icon icon name
opacity opacity of icon. from [0, 1]
Returns
  • drawable

public Drawable getIconDrawable (Context context)

Gets icon drawable

Parameters
context The context to get resource
Returns
  • drawable

public static Drawable getIconDrawable (Context context, String iconOutline, String iconFill, int color, float opacity)

Gets icon drawable based on icon name, opacity

Parameters
context The context to get resources
iconOutline name of icon outline
iconFill name of icon fill
opacity opacity of icon. from [0, 1]
Returns
  • drawable

public Eraser.InkEraserMode getInkEraserMode ()

Gets the ink eraser mode

Returns
  • the ink eraser mode

public float getLetterSpacing ()

public LineEndingStyle getLineEndStyle ()

public LineEndingStyle getLineStartStyle ()

public LineStyle getLineStyle ()

public float getOpacity ()

Gets opacity of annotation style

Returns
  • opacity

public String getOverlayText ()

Gets overlay text. Used for Redaction annotation and Watermark

Returns
  • overlay text

public String getPDFTronFontName ()

Gets PDFTron font name for free text annotation. This is equivalent to calling annotStyle.getFont().getPDFTronName();

Returns
  • font pdftron font name

public int getPrecision ()

public boolean getPressureSensitive ()

Gets whether pressure sensitivity is used.

Returns
  • true if pressure sensitivity is used.

public String getRulerBaseUnit ()

Gets the ruler base unit

Returns
  • the unit

public float getRulerBaseValue ()

Gets the ruler base value

Returns
  • the value

public RulerItem getRulerItem ()

Gets the ruler item

Returns
  • the ruler item

public String getRulerTranslateUnit ()

Gets the ruler translate unit

Returns
  • the unit

public float getRulerTranslateValue ()

Gets the ruler translate value

Returns
  • the value

public boolean getSnap ()

Gets whether snap to points

Returns
  • true if snap to points, false otherwise

public String getStampId ()

Gets the identifier of stamp or signature.

public int getTextColor ()

Gets text color of free text annotation style

Returns
  • text color

public String getTextContent ()

Gets text content of free text annotation

Returns
  • content

public String getTextHTMLContent ()

public float getTextSize ()

Gets text size of free text annotation style

Returns
  • text size

public float getThickness ()

Gets stroke thickness of annotation style

Returns
  • thickness

public int getVerticalAlignment ()

public boolean hasBorderStyle ()

public boolean hasBorderStyleWithoutCloud ()

public boolean hasColor ()

Whether annotation style has color

Returns
  • true then annotation has color, false otherwise

public boolean hasFillColor ()

Whether annotation style has fill color

Returns
  • true then annotation has fill color, false otherwise

public boolean hasFont ()

Whether annotation style should have font.

Returns
  • true if annotation style should have font information, false otherwise

public boolean hasIcon ()

Whether annotation style has icon

Returns
  • true then annotation has icon, false otherwise

public boolean hasLineEndStyle ()

public boolean hasLineStartStyle ()

public boolean hasLineStyle ()

public boolean hasOpacity ()

Whether annotation style has opacity

Returns
  • true then annotation has opacity, false otherwise

public boolean hasPressureSensitivity ()

Whether annotation style should have pressure sensitivity setting.

Returns
  • true if annotation style should have pressure sensitivity setting.

public boolean hasStampId ()

Whether annotation style should have stamp id

Returns
  • true if annotation style should have stamp id, false otherwise

public boolean hasTextAlignment ()

Whether annotation style should have text alignment options

Returns
  • true if annotation style should have text alignment options, false otherwise

public boolean hasTextStyle ()

Whether annotation style should have text style (i.e. text color and text size).

Returns
  • true if annotation style should have text style, false otherwise

public boolean hasThickness ()

Whether annotation style has border thickness

Returns
  • true then annotation has border thickness, false otherwise

public int hashCode ()

public boolean isBasicFreeText ()

Whether annotation style is freetext annotation but not callout or contains rich content

Returns
  • true then annotation is freetext annotation but not callout or contains rich content, false otherwise

public boolean isCallout ()

Whether annotation style is callout annotation

Returns
  • true then annotation is callout annotation, false otherwise

public boolean isCountMeasurement ()

Whether annotation style is count measurement

Returns
  • true then annotation is count measurement, false otherwise

public boolean isDateFreeText ()

Whether annotation style is free text with date

Returns
  • true if annotation is free text with date, false otherwise

public boolean isEnabled ()

public boolean isEraser ()

Whether style is eraser

Returns
  • true if is eraser, false otherwise

public boolean isFreeText ()

Whether annotation style is freetext annotation

Returns
  • true then annotation is freetext annotation, false otherwise

public static boolean isFreeTextGroup (int annotType)

Whether annotation type is any variant of FreeText

Parameters
annotType the annotation type
Returns
  • true if annotation type is a variant of FreeText, false otherwise

public boolean isFreeTextGroup ()

Whether annotation style base is FreeText This can mean any variation of FreeText

Returns
  • true if annotation is a variant of FreeText, false otherwise

public boolean isLine ()

Whether annotation style is line annotation

Returns
  • true then annotation is line annotation, false otherwise

public boolean isMeasurement ()

Whether annotation style is measurement annotation

Returns
  • true if annotation is any of distance/perimeter/area, false otherwise

public boolean isRCFreeText ()

Whether annotation style is free text with rich content

Returns
  • true then annotation is free text with rich content, false otherwise

public boolean isRedaction ()

Whether annotation style is redaction

Returns
  • true then annotation is redaction annotation, false otherwise

public boolean isRubberStamp ()

Whether annotation style is rubber stamp annotation

Returns
  • true then annotation is rubber stamp annotation, false otherwise

public boolean isRuler ()

Whether annotation style is ruler

Returns
  • true then annotation is line annotation, false otherwise

public boolean isSignature ()

Whether annotation style is signature annotation

Returns
  • true then annotation is signature annotation, false otherwise

public boolean isSound ()

Whether annotation style is sound

Returns
  • true then annotation is sound, false otherwise

public boolean isSpacingFreeText ()

Whether annotation style is free text with spacing

Returns
  • true then annotation is free text with spacing, false otherwise

public boolean isSquare ()

Whether annotation style is square annotation

Returns
  • true then annotation is square annotation, false otherwise

public boolean isStickyNote ()

Whether annotation style is sticky note

Returns
  • true then annotation is sticky note, false otherwise

public boolean isWatermark ()

Whether annotation style is watermark

Returns
  • true if annotation is watermark, false otherwise

public boolean isWidget ()

Whether annotation style is Widget annotation

Returns
  • true then annotation is Widget annotation, false otherwise

public static AnnotStyle loadJSONString (Context context, String jsonStr, int annotType)

Convert JSON String to annotation style

Parameters
context the context
jsonStr json string
annotType annotation type
Returns
  • annotation style

public static AnnotStyle loadJSONString (String jsonStr)

Convert JSON String to annotation style

Parameters
jsonStr json string
Returns
  • annotation style

public void setAnnotAppearanceChangeListener (AnnotStyle.OnAnnotStyleChangeListener listener)

Sets annotation style change listener

Parameters
listener annotation style change listener

public void setAnnotType (int annotType)

Sets annotation type, can be obtained from getType()

Parameters
annotType annotation type

public void setBorderEffectIntensity (double intensity)

Sets the border effect intensity

Parameters
intensity border effect intensity

public void setBorderStyle (ShapeBorderStyle borderStyle)

Sets border style.

Parameters
borderStyle border style

public void setDateFormat (String format)

public void setEnabled (boolean enabled)

public void setEraserType (Eraser.EraserType type)

Sets eraser type

Parameters
type the eraser type

public void setFillColor (int fillColor)

Sets fill color. For Markup annotation, fill color can be obtained from getInteriorColor(); For FreeText annotation, fill color can be obtained from getColorAsRGB()

Parameters
fillColor fill color

public void setFont (FontResource font)

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);
         
       }
     }
 }
 

Parameters
font font

public void setHorizontalAlignment (int alignment)

public void setIcon (String icon)

Sets icon for Text annotation. Icon can be obtained from getIconName()

Parameters
icon icon

public void setInkEraserMode (Eraser.InkEraserMode mode)

Sets the ink eraser mode

Parameters
mode the eraser mode

public void setLetterSpacing (float spacing)

public void setLineEndStyle (LineEndingStyle lineEndStyle)

Sets line ending style.

Parameters
lineEndStyle line ending style

public void setLineStartStyle (LineEndingStyle lineStartStyle)

Sets line start style.

Parameters
lineStartStyle line start style

public void setLineStyle (LineStyle lineStyle)

Sets line style.

Parameters
lineStyle border style

public void setOpacity (float opacity)

Sets opacity for Markup annotation. Opacity can be obtained from getOpacity()

Parameters
opacity opacity

public void setOpacity (float opacity, boolean done)

Sets opacity for Markup annotation. Opacity can be obtained from getOpacity()

Parameters
opacity opacity
done done sliding

public void setOverlayText (String text)

Sets overlay text. Used for Redaction annotation and Watermark

Parameters
text overlay text

public void setPressureSensitivity (boolean hasPressure)

Sets whether pressure sensitivity is enabled.

Parameters
hasPressure whether to enable pressure sensitivity.

public void setRulerBaseUnit (String unit)

Sets ruler base unit

Parameters
unit the unit

public void setRulerBaseValue (float value)

Sets ruler base value

Parameters
value the value

public void setRulerItem (RulerItem ruler)

Sets ruler properties

Parameters
ruler the ruler

public void setRulerPrecision (int precision)

public void setRulerTranslateUnit (String unit)

Sets ruler translate unit

Parameters
unit the unit

public void setRulerTranslateValue (float value)

Sets ruler translate value

Parameters
value the value

public void setSnap (boolean snap)

Sets snap.

Parameters
snap whether to snap to points

public void setStampId (String stampId)

Sets the identifier of stamp or signature.

Parameters
stampId the unique identifier

public void setStrokeColor (int strokeColor)

Sets stroke color. For normal annotation, stroke color can be obtained from getColorAsRGB(); For FreeText annotation, stroke color can be obtained from getLineColor()

Parameters
strokeColor stroke color

public void setStyle (AnnotStyle other)

Copy other annotation style

Parameters
other other annotation style

public void setStyle (int strokeColor, int fillColor, float thickness, float opacity)

Sets annotation style

Parameters
strokeColor stroke color
fillColor fill color
thickness stroke thickness
opacity opacity

public void setTextColor (int textColor)

Sets text color for FreeText and Widget annotations. text color can be obtained from getTextColor() or getTextColor()

Parameters
textColor text color

public void setTextContent (String content)

Sets content of FreeText annotation.

Parameters
content content

public void setTextHTMLContent (String html)

public void setTextSize (float textSize, boolean done)

Sets text size for FreeText annotation. text size can be obtained from getFontSize()

Parameters
textSize text size
done done sliding

public void setTextSize (float textSize)

Sets text size for FreeText annotation. text size can be obtained from getFontSize()

Parameters
textSize text size

public void setThickness (float thickness)

Sets stroke thickness. Annotation stroke thickness can be obtained from getWidth()

Parameters
thickness border style thickness

public void setThickness (float thickness, boolean done)

Sets stroke thickness. Annotation stroke thickness can be obtained from getWidth()

Parameters
thickness border style thickness
done done sliding

public void setVerticalAlignment (int alignment)

public String toJSONString ()

Convert annotation style to string in json format

Returns
  • json format string

public String toString ()

public void updateAllListeners ()

public void updateBorderStyleListener (ShapeBorderStyle borderStyle, boolean update)

public void updateLineEndStyleListener (LineEndingStyle lineEndStyle, boolean update)

public void updateLineStartStyleListener (LineEndingStyle lineStartStyle, boolean update)

public void updateLineStyleListener (LineStyle lineStyle, boolean update)

public void updateTextAlignment (int horizontalAlignment, int verticalAlignment, boolean update)

public void updateTextSizeListener (float textSize, boolean update, boolean done)

Update text size to listener

Parameters
textSize textSize
update whether to invoke listener method

public void updateThicknessListener (float thickness, boolean update, boolean done)

Update thickness to listener

Parameters
thickness thickness
update whether to invoke listener method