Class CPDFFreetextAnnotation

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

public class CPDFFreetextAnnotation extends CPDFAnnotation
A free text annotation displays text directly on the page.
  • Method Details

    • setFreetextDa

      public boolean setFreetextDa(CPDFTextAttribute freetextDa)
      Sets Freetext font style.
      Parameters:
      freetextDa - Font style.
      Returns:
      Returns whether to successfully set Freetext font style.
    • getFreetextDa

      public CPDFTextAttribute getFreetextDa()
      Gets Freetext font style.
      Returns:
      Returns font style.
    • setFreetextAlignment

      public boolean setFreetextAlignment(CPDFFreetextAnnotation.Alignment alignment)
      Sets text alignment of Freetext.
      Parameters:
      alignment - Text alignment.
      Returns:
      Returns whether to successfully set text alignment of Freetext.
    • getFreetextAlignment

      public CPDFFreetextAnnotation.Alignment getFreetextAlignment()
      Gets text alignment of Freetext.
      Returns:
      Returns text alignment of Freetext.
    • 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)
    • setRect

      public boolean setRect(RectF rectF)
      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:
      rectF - Rectangle on the page.
      Returns:
      Returns whether to successfully set annotation rectangle.
    • setContentAndRect

      public boolean setContentAndRect(String content, RectF rectF)
    • 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.
    • getContent

      public String getContent()
      Gets content of FreeText annotation.
      Overrides:
      getContent in class CPDFAnnotation
      Returns:
      Returns content of FreeText annotation.
    • setContent

      public boolean setContent(String content)
      Sets content of FreeText annotation.
      Overrides:
      setContent in class CPDFAnnotation
      Parameters:
      content - Content of FreeText annotation.
      Returns:
      Returns whether to successfully set annotations of FreeText.
    • getBorderStyle

      public CPDFBorderStyle getBorderStyle()
      Gets the border style, more: CPDFBorderStyle
      Returns:
      Returns the border style, more: CPDFBorderStyle
    • setBorderStyle

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