Package com.compdfkit.core.annotation
Class CPDFInkAnnotation
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.CPDFInkAnnotation
Displays one or more disjoint paths on a page. This is typically used to represent a freehand jotting or “scribble” of handwritten text.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compdfkit.core.annotation.CPDFAnnotation
CPDFAnnotation.AppearanceType, CPDFAnnotation.Flags, CPDFAnnotation.PSOAnnotationState, CPDFAnnotation.Type -
Method Summary
Modifier and TypeMethodDescriptionintgetAlpha()Gets opacity.floatGets border width of ink annotation.intgetColor()Gets color.PointF[][]Gets ink path.getRect()Gets annotation rectangle.booleansetAlpha(int alpha) Sets opacity.booleansetBorderWidth(float borderWidth) Sets border width of ink annotation.booleansetColor(int color) Sets color.booleansetInkPath(PointF[][] path) Sets ink path.booleanSets annotation rectangle.booleanupdateAp()Updates annotation appearance.Methods inherited from class com.compdfkit.core.annotation.CPDFAnnotation
addToPage, close, createReplyAnnotation, createReplyStateAnnotation, getContent, getCreationDate, getFlags, getMainAnnotNM, getName, getRecentlyModifyDate, getReplies, getState, getTitle, getType, hasAp, isAllowCorrectAnnotationAp, isExitMainAnnot, isHidden, isLocked, isMarkedStateAnnot, isReplyAnnot, isReviewStateAnnot, isValid, removeFromPage, removeFromPageIncludeReplyAnnot, setAllowCorrectAnnotationAp, setContent, setCreationDate, setFlags, setHidden, setLocked, setMarkedAnnotState, setName, setRecentlyModifyDate, setReviewAnnotState, setState, setTitle
-
Method Details
-
setInkPath
Sets ink path.- Parameters:
path- Points collection on the path, path is two-dimensional array, the first dimension represents all coordinate points in one path, the second dimension represents all ink path.- Returns:
- Returns whether to successfully set ink path.
-
getInkPath
Gets ink path.- Returns:
- Returns points collection on the path, path is two-dimensional array,the first dimension represents all coordinate points in one path, the second dimension represents all ink path.
-
setColor
public boolean setColor(int color) Sets color.- Parameters:
color- Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set color.
-
getColor
public int getColor()Gets color.- Returns:
- Returns color value (0x00000000~0xFFFFFFFF)
-
setAlpha
public boolean setAlpha(int alpha) Sets opacity.- Parameters:
alpha- Opacity value (0~255)- Returns:
- Returns whether to successfully set opacity.
-
getAlpha
public int getAlpha()Gets opacity.- Returns:
- Returns opacity value (0~255)
-
getBorderWidth
public float getBorderWidth()Gets border width of ink annotation.- Returns:
- Returns border width of ink annotation.
-
setBorderWidth
public boolean setBorderWidth(float borderWidth) Sets border width of ink annotation.- Parameters:
borderWidth- Border width of ink annotation.- Returns:
- Returns whether to successfully set border width of ink annotation.
-
getRect
Gets annotation rectangle. The page coordinate system has its origin at the left-bottom corner of the page, with the X-axis on the bottom going to the right, and the Y-axis on the left side going up. The device coordinate system is device dependent. For screen device, its origin is at the left-top corner of the window.- Overrides:
getRectin classCPDFAnnotation- Returns:
- Returns rectangle on the page.
-
setRect
Sets annotation rectangle. The page coordinate system has its origin at the left-bottom corner of the page, with the X-axis on the bottom going to the right, and the Y-axis on the left side going up. The device coordinate system is device dependent. For screen device, its origin is at the left-top corner of the window.- Overrides:
setRectin classCPDFAnnotation- Parameters:
rect- Rectangle on the page.- Returns:
- Returns whether to successfully set annotation rectangle.
-
updateAp
public boolean updateAp()Updates annotation appearance. Call this function to update annotation appearance after modifying annotation attribute.- Returns:
- Returns whether to successfully update annotation appearance.
-