Package com.compdfkit.core.annotation
Class CPDFFreetextAnnotation
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.CPDFFreetextAnnotation
A free text annotation displays text directly on the page.
-
Nested Class Summary
Nested ClassesNested 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.Gets the border style, more:CPDFBorderStyleGets content of FreeText annotation.Gets text alignment of Freetext.Gets Freetext font style.getRect()Gets annotation rectangle.booleansetAlpha(int alpha) Sets opacity.booleansetBorderStyle(CPDFBorderStyle borderStyle) Sets the border style, more:CPDFBorderStylebooleansetContent(String content) Sets content of FreeText annotation.booleansetContentAndRect(String content, RectF rectF) booleanSets text alignment of Freetext.booleansetFreetextDa(CPDFTextAttribute freetextDa) Sets Freetext font style.booleanSets annotation rectangle.booleanupdateAp()Updates annotation appearance.Methods inherited from class com.compdfkit.core.annotation.CPDFAnnotation
addToPage, close, createReplyAnnotation, createReplyStateAnnotation, getCreationDate, getFlags, getMainAnnotNM, getName, getRecentlyModifyDate, getReplies, getState, getTitle, getType, hasAp, isAllowCorrectAnnotationAp, isExitMainAnnot, isHidden, isLocked, isMarkedStateAnnot, isReplyAnnot, isReviewStateAnnot, isValid, removeFromPage, removeFromPageIncludeReplyAnnot, setAllowCorrectAnnotationAp, setCreationDate, setFlags, setHidden, setLocked, setMarkedAnnotState, setName, setRecentlyModifyDate, setReviewAnnotState, setState, setTitle
-
Method Details
-
setFreetextDa
Sets Freetext font style.- Parameters:
freetextDa- Font style.- Returns:
- Returns whether to successfully set Freetext font style.
-
getFreetextDa
Gets Freetext font style.- Returns:
- Returns font style.
-
setFreetextAlignment
Sets text alignment of Freetext.- Parameters:
alignment- Text alignment.- Returns:
- Returns whether to successfully set text alignment of Freetext.
-
getFreetextAlignment
Gets text alignment of Freetext.- Returns:
- Returns text alignment of Freetext.
-
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)
-
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:
rectF- Rectangle on the page.- Returns:
- Returns whether to successfully set annotation rectangle.
-
setContentAndRect
-
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 annotation rectangle.
-
getContent
Gets content of FreeText annotation.- Overrides:
getContentin classCPDFAnnotation- Returns:
- Returns content of FreeText annotation.
-
setContent
Sets content of FreeText annotation.- Overrides:
setContentin classCPDFAnnotation- Parameters:
content- Content of FreeText annotation.- Returns:
- Returns whether to successfully set annotations of FreeText.
-
getBorderStyle
Gets the border style, more:CPDFBorderStyle- Returns:
- Returns the border style, more:
CPDFBorderStyle
-
setBorderStyle
Sets the border style, more:CPDFBorderStyle- Parameters:
borderStyle- Border style, more:CPDFBorderStyle- Returns:
- Returns whether to successfully set border style.
-
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.
-