Class CPDFLineAnnotation

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

public class CPDFLineAnnotation extends CPDFAnnotation
A TPDFLineAnnotation object displays a single line on a page.
  • Method Details

    • setLinePoints

      public boolean setLinePoints(PointF start, PointF end)
      Sets start point and end point of the line.
      Parameters:
      start - Start point of the line.
      end - End point of the line.
      Returns:
      Returns whether to successfully set the start point and end point of the line.
    • getLinePoints

      public PointF[] getLinePoints()
      Gets start point and end point of the line.
      Returns:
      Returns an array of length 2, the first element is start point, the second element is the end point.
    • setLineType

      public boolean setLineType(CPDFLineAnnotation.LineType start, CPDFLineAnnotation.LineType end)
      Sets the line style for the starting point and ending point of the line, more: CPDFLineAnnotation.LineType
      Parameters:
      start - Line style for the starting point, more: CPDFLineAnnotation.LineType
      end - Line style for the ending point, more: CPDFLineAnnotation.LineType
      Returns:
      Returns whether to successfully set the line style for the starting point and ending point of the line.
    • getLineHeadType

      public CPDFLineAnnotation.LineType getLineHeadType()
      Gets the line style for the starting point of the line, more:CPDFLineAnnotation.LineType
      Returns:
      Returns the line style for the starting point of the line, more:CPDFLineAnnotation.LineType
    • getLineTailType

      public CPDFLineAnnotation.LineType getLineTailType()
      Gets the line style for the ending point of the line, more: CPDFLineAnnotation.LineType
      Returns:
      Returns the line style for the ending point of the line, more:CPDFLineAnnotation.LineType
    • setBorderColor

      public boolean setBorderColor(int color)
      Sets line color.
      Parameters:
      color - Color value (0x00000000~0xFFFFFFFF)
      Returns:
      Returns whether to successfully set color.
    • getBorderColor

      public int getBorderColor()
      Gets line color.
      Returns:
      Returns color value (0x00000000~0xFFFFFFFF)
    • setFillColor

      public boolean setFillColor(int color)
      Sets fill color of line.
      Parameters:
      color - Color value (0x00000000~0xFFFFFFFF)
      Returns:
      Returns whether to successfully set fill color of line.
    • getFillColor

      public int getFillColor()
      Gets fill color of line.
      Returns:
      Returns fill color value(0x00000000~0xFFFFFFFF)
    • setBorderAlpha

      public boolean setBorderAlpha(int lineAlpha)
      Sets line opacity.
      Parameters:
      lineAlpha - Opacity value (0~255)
      Returns:
      Returns whether to successfully set opacity.
    • getFillAlpha

      public int getFillAlpha()
      Gets fill opacity of line.
      Returns:
      Returns line fill opacity value (0~255)
    • setFillAlpha

      public boolean setFillAlpha(int fillAlpha)
      Sets fill opacity of line.
      Parameters:
      fillAlpha - Opacity value (0~255)
      Returns:
      Returns whether to successfully set fill opacity of line.
    • getBorderAlpha

      public int getBorderAlpha()
      Gets fill opacity of line.
      Returns:
      Returns line fill opacity value (0~255)
    • getBorderStyle

      public CPDFBorderStyle getBorderStyle()
      Gets border style.
      Returns:
      Returns border style.
    • setBorderStyle

      public boolean setBorderStyle(CPDFBorderStyle borderStyle)
      Sets border style.
      Parameters:
      borderStyle - Border style.
      Returns:
      Returns whether to successfully set border style.
    • 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.
    • 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.