Class CPDFTextWidget


public class CPDFTextWidget extends CPDFWidget
A text form field in a PDF form. Allows the user to enter custom text.
  • Method Details

    • setText

      public boolean setText(String text)
      Sets the text content in TextField.
      Parameters:
      text - Text content.
      Returns:
      Returns whether to successfully set the text content in TextField.
    • getText

      public String getText()
      Gets the text content in TextField.
      Returns:
      Returns the text content in TextField.
    • isMultiLine

      public boolean isMultiLine()
      Whether to display multiline PDF text fields.
      Returns:
      Returns whether to display multiline PDF text fields.
    • setMultiLine

      public boolean setMultiLine(boolean isMultiLine)
      Sets to display multiline PDF text fields.
      Parameters:
      isMultiLine - Whether to display multiline PDF text fields.
      Returns:
      Returns whether to successfully display multiline PDF text fields.
    • isPassword

      public boolean isPassword()
      Whether the TextField content display password, password :*****
      Returns:
      Returns whether the TextField content display password.
    • setFontName

      public boolean setFontName(String fontName)
      Sets the font format of text content, get the font name.
      Parameters:
      fontName - Font name of text.
      Returns:
      Whether to successfully set the text content font in TextField.
    • getFontName

      public String getFontName()
      Gets the text content font in TextField, get the font type in according to font names. Whether the font is italic according to font names
      Returns:
      Returns font names in TextField
    • setFontSize

      public boolean setFontSize(float fontsize)
      Sets the font size of text content in TextField.
      Parameters:
      fontsize - Font size.
      Returns:
      Returns whether to successfully set the font size of text.
    • getFontSize

      public float getFontSize()
      Gets the font size of text content in TextField.
      Returns:
      Returns the font size of text content in TextField.
    • setFontColor

      public boolean setFontColor(int color)
      Sets the font color of text content in TextField.
      Parameters:
      color - Text color.
      Returns:
      Returns whether to set text color successfully.
    • getFontColor

      public int getFontColor()
      Gets the font color of text content in TextField.
      Returns:
      Returns the font color of text content in TextField.
    • setTextAlignment

      public boolean setTextAlignment(CPDFTextAlignment alignment)
      Sets the text alignment in TextField, more: CPDFTextAlignment
      Parameters:
      alignment - Alignment.
      Returns:
      Returns whether to successfully set the text alignment.
    • getTextAlignment

      public CPDFTextAlignment getTextAlignment()
      Gets the the text alignment in TextField, more: CPDFTextAlignment
      Returns:
      Returns text alignment.
    • setTextFieldSpecial

      public boolean setTextFieldSpecial(boolean isDateSpecial)
      Sets the content format of TextField, format type: CPDFTextWidget.TextFiledSpecial
      Parameters:
      isDateSpecial - Whether to be date format.
      Returns:
      Returns whether to successfully set content format of TextField.
    • getTextFieldSpecial

      public CPDFTextWidget.TextFiledSpecial getTextFieldSpecial()
      Gets the content format of TextField, format type:CPDFTextWidget.TextFiledSpecial
      Returns:
      Returns the content format of TextField.
    • resetForm

      public boolean resetForm()
      Resets TextField forms, content of TextField is cleared up
      Overrides:
      resetForm in class CPDFWidget
      Returns:
      Returns whether to successfully reset TextField forms.