Class CPDFSquareAnnotation

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

public class CPDFSquareAnnotation extends CPDFAnnotation
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.
  • 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

      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 rectangle on the page.
    • setBorderStyle

      public boolean setBorderStyle(CPDFBorderStyle borderStyle)
      Sets border style, more: CPDFBorderStyle
      Parameters:
      borderStyle - Border style, more: CPDFBorderStyle
      Returns:
      Returns whether to successfully set border style.
    • getBorderStyle

      public CPDFBorderStyle 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.