Class CPDFInkAnnotation

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

public class CPDFInkAnnotation extends CPDFAnnotation
Displays one or more disjoint paths on a page. This is typically used to represent a freehand jotting or “scribble” of handwritten text.
  • Method Details

    • setInkPath

      public boolean setInkPath(PointF[][] path)
      Sets ink path.
      Parameters:
      path - Points collection on the path, path is two-dimensional array, the first dimension represents all coordinate points in one path, the second dimension represents all ink path.
      Returns:
      Returns whether to successfully set ink path.
    • getInkPath

      public PointF[][] getInkPath()
      Gets ink path.
      Returns:
      Returns points collection on the path, path is two-dimensional array,the first dimension represents all coordinate points in one path, the second dimension represents all ink path.
    • setColor

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

      public int getColor()
      Gets color.
      Returns:
      Returns color value (0x00000000~0xFFFFFFFF)
    • 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)
    • getBorderWidth

      public float getBorderWidth()
      Gets border width of ink annotation.
      Returns:
      Returns border width of ink annotation.
    • setBorderWidth

      public boolean setBorderWidth(float borderWidth)
      Sets border width of ink annotation.
      Parameters:
      borderWidth - Border width of ink annotation.
      Returns:
      Returns whether to successfully set border width of ink annotation.
    • 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.
    • 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.
    • 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.