Class CPDFRedactAnnotation

java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.CPDFRedactAnnotation

public class CPDFRedactAnnotation extends CPDFAnnotation
Redaction Annotation used to remove content from a document.
  • Method Details

    • getOverLayText

      public String getOverLayText()
      Gets the text displayed in the specified area after applying the redaction.
      Returns:
      The text displayed in the specified area.
    • setOverLayText

      public boolean setOverLayText(String text)
      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

      public boolean setTextDa(CPDFTextAttribute textDa)
      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

      public CPDFTextAttribute getTextDa()
      Gets the text attribute displayed in the specified area after applying the redaction.
      Returns:
      Returns text attribute.
    • setTextAlignment

      public boolean setTextAlignment(CPDFTextAlignment alignment)
      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

      public CPDFTextAlignment 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

      public boolean setQuadRects(RectF[] quadRects)
      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

      public RectF[] 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

      public boolean setRect(RectF rect)
      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:
      setRect in class CPDFAnnotation
      Parameters:
      rect - Rectangle on the page
      Returns:
      Returns whether to successfully set annotation rectangle.
    • getRect

      public RectF 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:
      getRect in class CPDFAnnotation
      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.