Class PdfFormField

All Implemented Interfaces:
IAccessibleElement, Serializable

public class PdfFormField extends PdfAnnotation
Implements form fields.
See Also:
  • Field Details

  • Constructor Details

    • PdfFormField

      public PdfFormField(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action)
      Constructs a new PdfAnnotation of subtype link (Action).
    • PdfFormField

      protected PdfFormField(PdfWriter writer)
      Creates new PdfFormField
  • Method Details

    • setWidget

      public void setWidget(Rectangle rect, PdfName highlight)
    • createEmpty

      public static PdfFormField createEmpty(PdfWriter writer)
    • setButton

      public void setButton(int flags)
    • createButton

      protected static PdfFormField createButton(PdfWriter writer, int flags)
    • createPushButton

      public static PdfFormField createPushButton(PdfWriter writer)
    • createCheckBox

      public static PdfFormField createCheckBox(PdfWriter writer)
    • createRadioButton

      public static PdfFormField createRadioButton(PdfWriter writer, boolean noToggleToOff)
    • createTextField

      public static PdfFormField createTextField(PdfWriter writer, boolean multiline, boolean password, int maxLen)
    • createChoice

      protected static PdfFormField createChoice(PdfWriter writer, int flags, PdfArray options, int topIndex)
    • createList

      public static PdfFormField createList(PdfWriter writer, String[] options, int topIndex)
    • createList

      public static PdfFormField createList(PdfWriter writer, String[][] options, int topIndex)
    • createCombo

      public static PdfFormField createCombo(PdfWriter writer, boolean edit, String[] options, int topIndex)
    • createCombo

      public static PdfFormField createCombo(PdfWriter writer, boolean edit, String[][] options, int topIndex)
    • processOptions

      protected static PdfArray processOptions(String[] options)
    • processOptions

      protected static PdfArray processOptions(String[][] options)
    • createSignature

      public static PdfFormField createSignature(PdfWriter writer)
    • getParent

      public PdfFormField getParent()
      Getter for property parent.
      Returns:
      Value of property parent.
    • addKid

      public void addKid(PdfFormField field)
    • getKids

      public ArrayList<PdfFormField> getKids()
    • setFieldFlags

      public int setFieldFlags(int flags)
      ORs together the given flags with the current /Ff value.
      Parameters:
      flags - flags to be added.
      Returns:
      the old flag value
    • setValueAsString

      public void setValueAsString(String s)
    • setValueAsName

      public void setValueAsName(String s)
    • setValue

      public void setValue(PdfSignature sig)
    • setRichValue

      public void setRichValue(String rv)
      Sets the rich value for this field. It is suggested that the regular value of this field be set to an equivalent value. Rich text values are only supported since PDF 1.5, and require that the FF_RV flag be set. See PDF Reference chapter 12.7.3.4 for details.
      Parameters:
      rv - HTML markup for the rich value of this field
      Since:
      5.0.6
    • setDefaultValueAsString

      public void setDefaultValueAsString(String s)
    • setDefaultValueAsName

      public void setDefaultValueAsName(String s)
    • setFieldName

      public void setFieldName(String s)
    • setUserName

      public void setUserName(String s)
      The "user name" is the text shown as a tool.
      Parameters:
      s - user name.
    • setMappingName

      public void setMappingName(String s)
      The mapping name is the name this field uses when submitting form data.
      Parameters:
      s -
    • setQuadding

      public void setQuadding(int v)
      Sets text alginment for this field
      Parameters:
      v - one of the Q_* contstants
    • mergeResources

      static void mergeResources(PdfDictionary result, PdfDictionary source, PdfStamperImp writer)
    • mergeResources

      static void mergeResources(PdfDictionary result, PdfDictionary source)
    • setUsed

      public void setUsed()
      Description copied from class: PdfAnnotation
      Setter for property used.
      Overrides:
      setUsed in class PdfAnnotation
    • shallowDuplicate

      public static PdfAnnotation shallowDuplicate(PdfAnnotation annot)