Package com.compdfkit.core.annotation
Class CPDFSquareAnnotation
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.CPDFSquareAnnotation
Square annotation is a rectangle on the page. Despite the name "square", a square annotation can represent either a square or a rectangle, which means the width and height of the annotation rectangle need not be equal.
-
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 TypeMethodDescriptionintGets border opacity.intGets border color.Gets the border style, more:CPDFBorderStyleintGets background opacity.intGets background color.getRect()Gets annotation rectangle.booleansetBorderAlpha(int lineAlpha) Sets border opacity.booleansetBorderColor(int color) Sets border color.booleansetBorderStyle(CPDFBorderStyle borderStyle) Sets border style, more:CPDFBorderStylebooleansetFillAlpha(int bgAlpha) Sets background opacity.booleansetFillColor(int color) Sets filled color.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
-
setBorderColor
public boolean setBorderColor(int color) Sets border color.- Parameters:
color- Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set border color.
-
getBorderColor
public int getBorderColor()Gets border color.- Returns:
- Returns color value (0x00000000~0xFFFFFFFF)
-
setBorderAlpha
public boolean setBorderAlpha(int lineAlpha) Sets border opacity.- Parameters:
lineAlpha- Opacity value (0~255)- Returns:
- Returns whether to successfully set border opacity.
-
getBorderAlpha
public int getBorderAlpha()Gets border opacity.- Returns:
- Returns opacity value (0~255)
-
setFillColor
public boolean setFillColor(int color) Sets filled color.- Parameters:
color- Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set filled color.
-
getFillColor
public int getFillColor()Gets background color.- Returns:
- Returns color value (0x00000000~0xFFFFFFFF)
-
setFillAlpha
public boolean setFillAlpha(int bgAlpha) Sets background opacity.- Parameters:
bgAlpha- Opacity value(0~255)- Returns:
- Returns whether to successfully set background opacity.
-
getFillAlpha
public int getFillAlpha()Gets background opacity.- Returns:
- Returns opacity value (0~255)
-
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.
-
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.
-
setBorderStyle
Sets border style, more:CPDFBorderStyle- Parameters:
borderStyle- Border style, more:CPDFBorderStyle- Returns:
- Returns whether to successfully set border style.
-
getBorderStyle
Gets the border style, more:CPDFBorderStyle- Returns:
- Returns the border style, more:
CPDFBorderStyle
-
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.
-