Package com.compdfkit.core.annotation
Class CPDFRedactAnnotation
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.CPDFRedactAnnotation
Redaction Annotation used to remove content from a document.
-
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 TypeMethodDescriptionbooleanApplies redaction annotation.booleanRemoves the fill color displayed in the specified area before applying the redaction.booleanRemoves the color used for the redaction’s border in its marked state.intReturns a fill color associated with this redaction or Color#BLACK if no color is set.intGets the fill color displayed in the specified area before applying the redaction.intGets the color used for the redaction’s border in its marked state.Gets the text displayed in the specified area after applying the redaction.RectF[]Gets the areas that should be covered by the redaction annotation.getRect()Gets annotation rectangle.Gets the text alignment displayed in the specified area after applying the redaction.Gets the text attribute displayed in the specified area after applying the redaction.booleansetFillColor(int color) Sets the fill color for this annotation.booleansetFillColorBeforeApply(int color) Sets the fill color displayed in the specified area before applying the redaction.booleansetOutlineColor(int outlineColor) Sets the color used for the redaction’s border in its marked state.booleansetOverLayText(String text) Sets the text displayed in the specified area after applying the redaction.booleansetQuadRects(RectF[] quadRects) Uses the rects property to set the areas that should be covered by the redaction annotation.booleanSets annotation rectangle.booleansetTextAlignment(CPDFTextAlignment alignment) Sets the text alignment displayed in the specified area after applying the redaction.booleansetTextDa(CPDFTextAttribute textDa) Sets the text attribute displayed in the specified area after applying the redaction.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
-
getOverLayText
Gets the text displayed in the specified area after applying the redaction.- Returns:
- The text displayed in the specified area.
-
setOverLayText
Sets the text displayed in the specified area after applying the redaction.- Parameters:
text- The text displayed in the specified area.- Returns:
- Returns whether to successfully set annotations of Redaction.
-
setTextDa
Sets the text attribute displayed in the specified area after applying the redaction.- Parameters:
textDa- Font style.- Returns:
- Returns whether to successfully set Redaction font style.
-
getTextDa
Gets the text attribute displayed in the specified area after applying the redaction.- Returns:
- Returns text attribute.
-
setTextAlignment
Sets the text alignment displayed in the specified area after applying the redaction.- Parameters:
alignment- Text alignment.- Returns:
- Returns whether to successfully set text alignment of Redaction.
-
getTextAlignment
Gets the text alignment displayed in the specified area after applying the redaction.- Returns:
- Returns text alignment.
-
setFillColor
public boolean setFillColor(int color) Sets the fill color for this annotation.- Parameters:
color- Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set color.
-
getFillColor
public int getFillColor()Returns a fill color associated with this redaction or Color#BLACK if no color is set. Note that alpha channel is not taken into account the exception being Color#TRANSPARENT which allows you remove the fill color all together as long as an overlay text is specified.- Returns:
- Color of redaction or @link{ Color#BLACK } Color#BLACK if no color is set. (0x00000000~0xFFFFFFFF)
-
setOutlineColor
public boolean setOutlineColor(int outlineColor) Sets the color used for the redaction’s border in its marked state. Defaults to red.- Parameters:
outlineColor- color Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set color.
-
getOutlineColor
public int getOutlineColor()Gets the color used for the redaction’s border in its marked state. Defaults to red.- Returns:
- Returns color value (0x00000000~0xFFFFFFFF)
-
clearOutlineColor
public boolean clearOutlineColor()Removes the color used for the redaction’s border in its marked state. Defaults to red.- Returns:
- Returns whether to successfully clear outline color.
-
setQuadRects
Uses the rects property to set the areas that should be covered by the redaction annotation. 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. Convert function: {@link CPDFPage.convertRectToPage(boolean, float, float, RectF)}.- Parameters:
quadRects- Array of quadrilateral points defining the bounds of the Redaction.- Returns:
- Returns whether to successfully set the array of quadrilateral points defining the bounds of the redaction.
-
getQuadRects
Gets the areas that should be covered by the redaction annotation. 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. Convert function: {@link CPDFPage.convertRectToPage(boolean, float, float, RectF)}.- Returns:
-
getFillColorBeforeApply
public int getFillColorBeforeApply()Gets the fill color displayed in the specified area before applying the redaction.- Returns:
- Returns color value (0x00000000~0xFFFFFFFF)
-
setFillColorBeforeApply
public boolean setFillColorBeforeApply(int color) Sets the fill color displayed in the specified area before applying the redaction.- Parameters:
color- Color value (0x00000000~0xFFFFFFFF)- Returns:
- Returns whether to successfully set color.
-
clearFillColorBeforeApply
public boolean clearFillColorBeforeApply()Removes the fill color displayed in the specified area before applying the redaction.- Returns:
- Returns whether to successfully clear outline color.
-
applyRedaction
public boolean applyRedaction()Applies redaction annotation.- Returns:
- Returns whether to successfully apply redaction
-
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 annotation rectangle on the page
-
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.
-