com.lowagie.text.pdf

## Class PdfAcroForm

- java.lang.Object
- - com.lowagie.text.pdf.PdfObject
  - - com.lowagie.text.pdf.PdfDictionary
    - - com.lowagie.text.pdf.PdfAcroForm

-     public class PdfAcroForm
      extends PdfDictionary

  Each PDF document can contain maximum 1 AcroForm.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private PdfArray` | `calculationOrder` This is an array containing the calculationorder of the fields.
    `private PdfArray` | `documentFields` This is an array containing DocumentFields.
    `private java.util.HashMap` | `fieldTemplates` This is a map containing FieldTemplates.
    `private int` | `sigFlags` Contains the signature flags.
    `private PdfWriter` | `writer`

    - ### Fields inherited from class com.lowagie.text.pdf.PdfDictionary

      `CATALOG, FONT, hashMap, OUTLINES, PAGE, PAGES`

    - ### Fields inherited from class com.lowagie.text.pdf.PdfObject

      `ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, indRef, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PdfAcroForm(PdfWriter writer)` Creates new PdfAcroForm

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCalculationOrder(PdfFormField formField)` Adds an object to the calculationOrder.
    `PdfFormField` | `addCheckBox(java.lang.String name, java.lang.String value, boolean status, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addComboBox(java.lang.String name, java.lang.String[][] options, java.lang.String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addComboBox(java.lang.String name, java.lang.String[] options, java.lang.String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `void` | `addDocumentField(PdfIndirectReference ref)` Adds documentFields.
    `void` | `addFieldTemplates(java.util.HashMap ft)` Adds fieldTemplates.
    `void` | `addFormField(PdfFormField formField)` Adds a formfield to the AcroForm.
    `PdfFormField` | `addHiddenField(java.lang.String name, java.lang.String value)`
    `PdfFormField` | `addHtmlPostButton(java.lang.String name, java.lang.String caption, java.lang.String value, java.lang.String url, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addMap(java.lang.String name, java.lang.String value, java.lang.String url, PdfContentByte appearance, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addMultiLineTextField(java.lang.String name, java.lang.String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addRadioButton(PdfFormField radiogroup, java.lang.String value, float llx, float lly, float urx, float ury)`
    `void` | `addRadioGroup(PdfFormField radiogroup)`
    `PdfFormField` | `addResetButton(java.lang.String name, java.lang.String caption, java.lang.String value, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addSelectList(java.lang.String name, java.lang.String[][] options, java.lang.String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addSelectList(java.lang.String name, java.lang.String[] options, java.lang.String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addSignature(java.lang.String name, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addSingleLinePasswordField(java.lang.String name, java.lang.String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `addSingleLineTextField(java.lang.String name, java.lang.String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `void` | `drawButton(PdfFormField button, java.lang.String caption, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `void` | `drawCheckBoxAppearences(PdfFormField field, java.lang.String value, float llx, float lly, float urx, float ury)`
    `void` | `drawMultiLineOfText(PdfFormField field, java.lang.String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `void` | `drawRadioAppearences(PdfFormField field, java.lang.String value, float llx, float lly, float urx, float ury)`
    `void` | `drawSignatureAppearences(PdfFormField field, float llx, float lly, float urx, float ury)`
    `void` | `drawSingleLineOfText(PdfFormField field, java.lang.String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)`
    `PdfFormField` | `getRadioGroup(java.lang.String name, java.lang.String defaultValue, boolean noToggleToOff)`
    `boolean` | `isValid()` Checks if the Acroform is valid
    `void` | `setButtonParams(PdfFormField button, int characteristics, java.lang.String name, java.lang.String value)`
    `void` | `setCheckBoxParams(PdfFormField field, java.lang.String name, java.lang.String value, boolean status, float llx, float lly, float urx, float ury)`
    `void` | `setChoiceParams(PdfFormField field, java.lang.String name, java.lang.String defaultValue, float llx, float lly, float urx, float ury)`
    `void` | `setNeedAppearances(boolean value)`
    `void` | `setSigFlags(int f)` Sets the signature flags.
    `void` | `setSignatureParams(PdfFormField field, java.lang.String name, float llx, float lly, float urx, float ury)`
    `void` | `setTextFieldParams(PdfFormField field, java.lang.String text, java.lang.String name, float llx, float lly, float urx, float ury)`

    - ### Methods inherited from class com.lowagie.text.pdf.PdfDictionary

      `contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString`

    - ### Methods inherited from class com.lowagie.text.pdf.PdfObject

      `canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### writer

          private PdfWriter writer

    - #### fieldTemplates

          private java.util.HashMap fieldTemplates

      This is a map containing FieldTemplates.

    - #### documentFields

          private PdfArray documentFields

      This is an array containing DocumentFields.

    - #### calculationOrder

          private PdfArray calculationOrder

      This is an array containing the calculationorder of the fields.

    - #### sigFlags

          private int sigFlags

      Contains the signature flags.

  - ### Constructor Detail

    - #### PdfAcroForm

          public PdfAcroForm(PdfWriter writer)

      Creates new PdfAcroForm
      Parameters:
        `writer` -

  - ### Method Detail

    - #### setNeedAppearances

          public void setNeedAppearances(boolean value)

    - #### addFieldTemplates

          public void addFieldTemplates(java.util.HashMap ft)

      Adds fieldTemplates.
      Parameters:
        `ft` -

    - #### addDocumentField

          public void addDocumentField(PdfIndirectReference ref)

      Adds documentFields.
      Parameters:
        `ref` -

    - #### isValid

          public boolean isValid()

      Checks if the Acroform is valid
      Returns:
        true if the Acroform is valid

    - #### addCalculationOrder

          public void addCalculationOrder(PdfFormField formField)

      Adds an object to the calculationOrder.
      Parameters:
        `formField` -

    - #### setSigFlags

          public void setSigFlags(int f)

      Sets the signature flags.
      Parameters:
        `f` -

    - #### addFormField

          public void addFormField(PdfFormField formField)

      Adds a formfield to the AcroForm.
      Parameters:
        `formField` -

    - #### addHtmlPostButton

          public PdfFormField addHtmlPostButton(java.lang.String name,
                                       java.lang.String caption,
                                       java.lang.String value,
                                       java.lang.String url,
                                       BaseFont font,
                                       float fontSize,
                                       float llx,
                                       float lly,
                                       float urx,
                                       float ury)

      Parameters:
        `name` -
        `caption` -
        `value` -
        `url` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addResetButton

          public PdfFormField addResetButton(java.lang.String name,
                                    java.lang.String caption,
                                    java.lang.String value,
                                    BaseFont font,
                                    float fontSize,
                                    float llx,
                                    float lly,
                                    float urx,
                                    float ury)

      Parameters:
        `name` -
        `caption` -
        `value` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addMap

          public PdfFormField addMap(java.lang.String name,
                            java.lang.String value,
                            java.lang.String url,
                            PdfContentByte appearance,
                            float llx,
                            float lly,
                            float urx,
                            float ury)

      Parameters:
        `name` -
        `value` -
        `url` -
        `appearance` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### setButtonParams

          public void setButtonParams(PdfFormField button,
                             int characteristics,
                             java.lang.String name,
                             java.lang.String value)

      Parameters:
        `button` -
        `characteristics` -
        `name` -
        `value` -

    - #### drawButton

          public void drawButton(PdfFormField button,
                        java.lang.String caption,
                        BaseFont font,
                        float fontSize,
                        float llx,
                        float lly,
                        float urx,
                        float ury)

      Parameters:
        `button` -
        `caption` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### addHiddenField

          public PdfFormField addHiddenField(java.lang.String name,
                                    java.lang.String value)

      Parameters:
        `name` -
        `value` -
      Returns:
        a PdfFormField

    - #### addSingleLineTextField

          public PdfFormField addSingleLineTextField(java.lang.String name,
                                            java.lang.String text,
                                            BaseFont font,
                                            float fontSize,
                                            float llx,
                                            float lly,
                                            float urx,
                                            float ury)

      Parameters:
        `name` -
        `text` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addMultiLineTextField

          public PdfFormField addMultiLineTextField(java.lang.String name,
                                           java.lang.String text,
                                           BaseFont font,
                                           float fontSize,
                                           float llx,
                                           float lly,
                                           float urx,
                                           float ury)

      Parameters:
        `name` -
        `text` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addSingleLinePasswordField

          public PdfFormField addSingleLinePasswordField(java.lang.String name,
                                                java.lang.String text,
                                                BaseFont font,
                                                float fontSize,
                                                float llx,
                                                float lly,
                                                float urx,
                                                float ury)

      Parameters:
        `name` -
        `text` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        PdfFormField

    - #### setTextFieldParams

          public void setTextFieldParams(PdfFormField field,
                                java.lang.String text,
                                java.lang.String name,
                                float llx,
                                float lly,
                                float urx,
                                float ury)

      Parameters:
        `field` -
        `text` -
        `name` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### drawSingleLineOfText

          public void drawSingleLineOfText(PdfFormField field,
                                  java.lang.String text,
                                  BaseFont font,
                                  float fontSize,
                                  float llx,
                                  float lly,
                                  float urx,
                                  float ury)

      Parameters:
        `field` -
        `text` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### drawMultiLineOfText

          public void drawMultiLineOfText(PdfFormField field,
                                 java.lang.String text,
                                 BaseFont font,
                                 float fontSize,
                                 float llx,
                                 float lly,
                                 float urx,
                                 float ury)

      Parameters:
        `field` -
        `text` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### addCheckBox

          public PdfFormField addCheckBox(java.lang.String name,
                                 java.lang.String value,
                                 boolean status,
                                 float llx,
                                 float lly,
                                 float urx,
                                 float ury)

      Parameters:
        `name` -
        `value` -
        `status` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### setCheckBoxParams

          public void setCheckBoxParams(PdfFormField field,
                               java.lang.String name,
                               java.lang.String value,
                               boolean status,
                               float llx,
                               float lly,
                               float urx,
                               float ury)

      Parameters:
        `field` -
        `name` -
        `value` -
        `status` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### drawCheckBoxAppearences

          public void drawCheckBoxAppearences(PdfFormField field,
                                     java.lang.String value,
                                     float llx,
                                     float lly,
                                     float urx,
                                     float ury)

      Parameters:
        `field` -
        `value` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### getRadioGroup

          public PdfFormField getRadioGroup(java.lang.String name,
                                   java.lang.String defaultValue,
                                   boolean noToggleToOff)

      Parameters:
        `name` -
        `defaultValue` -
        `noToggleToOff` -
      Returns:
        a PdfFormField

    - #### addRadioGroup

          public void addRadioGroup(PdfFormField radiogroup)

      Parameters:
        `radiogroup` -

    - #### addRadioButton

          public PdfFormField addRadioButton(PdfFormField radiogroup,
                                    java.lang.String value,
                                    float llx,
                                    float lly,
                                    float urx,
                                    float ury)

      Parameters:
        `radiogroup` -
        `value` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### drawRadioAppearences

          public void drawRadioAppearences(PdfFormField field,
                                  java.lang.String value,
                                  float llx,
                                  float lly,
                                  float urx,
                                  float ury)

      Parameters:
        `field` -
        `value` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### addSelectList

          public PdfFormField addSelectList(java.lang.String name,
                                   java.lang.String[] options,
                                   java.lang.String defaultValue,
                                   BaseFont font,
                                   float fontSize,
                                   float llx,
                                   float lly,
                                   float urx,
                                   float ury)

      Parameters:
        `name` -
        `options` -
        `defaultValue` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addSelectList

          public PdfFormField addSelectList(java.lang.String name,
                                   java.lang.String[][] options,
                                   java.lang.String defaultValue,
                                   BaseFont font,
                                   float fontSize,
                                   float llx,
                                   float lly,
                                   float urx,
                                   float ury)

      Parameters:
        `name` -
        `options` -
        `defaultValue` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addComboBox

          public PdfFormField addComboBox(java.lang.String name,
                                 java.lang.String[] options,
                                 java.lang.String defaultValue,
                                 boolean editable,
                                 BaseFont font,
                                 float fontSize,
                                 float llx,
                                 float lly,
                                 float urx,
                                 float ury)

      Parameters:
        `name` -
        `options` -
        `defaultValue` -
        `editable` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### addComboBox

          public PdfFormField addComboBox(java.lang.String name,
                                 java.lang.String[][] options,
                                 java.lang.String defaultValue,
                                 boolean editable,
                                 BaseFont font,
                                 float fontSize,
                                 float llx,
                                 float lly,
                                 float urx,
                                 float ury)

      Parameters:
        `name` -
        `options` -
        `defaultValue` -
        `editable` -
        `font` -
        `fontSize` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### setChoiceParams

          public void setChoiceParams(PdfFormField field,
                             java.lang.String name,
                             java.lang.String defaultValue,
                             float llx,
                             float lly,
                             float urx,
                             float ury)

      Parameters:
        `field` -
        `name` -
        `defaultValue` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### addSignature

          public PdfFormField addSignature(java.lang.String name,
                                  float llx,
                                  float lly,
                                  float urx,
                                  float ury)

      Parameters:
        `name` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -
      Returns:
        a PdfFormField

    - #### setSignatureParams

          public void setSignatureParams(PdfFormField field,
                                java.lang.String name,
                                float llx,
                                float lly,
                                float urx,
                                float ury)

      Parameters:
        `field` -
        `name` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -

    - #### drawSignatureAppearences

          public void drawSignatureAppearences(PdfFormField field,
                                      float llx,
                                      float lly,
                                      float urx,
                                      float ury)

      Parameters:
        `field` -
        `llx` -
        `lly` -
        `urx` -
        `ury` -