Class PdfAcroForm


public class PdfAcroForm extends PdfDictionary
Each PDF document can contain maximum 1 AcroForm.
  • Field Details

    • writer

      private final PdfWriter writer
    • fieldTemplates

      private final HashMap fieldTemplates
      This is a map containing FieldTemplates.
    • documentFields

      private final PdfArray documentFields
      This is an array containing DocumentFields.
    • calculationOrder

      private final PdfArray calculationOrder
      This is an array containing the calculationorder of the fields.
    • sigFlags

      private int sigFlags
      Contains the signature flags.
  • Constructor Details

    • PdfAcroForm

      public PdfAcroForm(PdfWriter writer)
      Creates new PdfAcroForm
      Parameters:
      writer - Writer to create
  • Method Details

    • setNeedAppearances

      public void setNeedAppearances(boolean value)
    • addFieldTemplates

      public void addFieldTemplates(HashMap ft)
      Adds fieldTemplates.
      Parameters:
      ft - Map to set
    • addDocumentField

      public void addDocumentField(PdfIndirectReference ref)
      Adds documentFields.
      Parameters:
      ref - Reference to set
    • 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 - FormField to set
    • setSigFlags

      public void setSigFlags(int f)
      Sets the signature flags.
      Parameters:
      f - Flags to set
    • addFormField

      private void addFormField(PdfFormField formField)
      Adds a formfield to the AcroForm.
      Parameters:
      formField -
    • setButtonParams

      private void setButtonParams(PdfFormField button, int characteristics, String name, String value)
      Parameters:
      button -
      characteristics -
      name -
      value -
    • drawButton

      private void drawButton(PdfFormField button, String caption, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)
      Parameters:
      button -
      caption -
      font -
      fontSize -
      llx -
      lly -
      urx -
      ury -
    • setTextFieldParams

      private void setTextFieldParams(PdfFormField field, String text, String name, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      text -
      name -
      llx -
      lly -
      urx -
      ury -
    • drawSingleLineOfText

      private void drawSingleLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      text -
      font -
      fontSize -
      llx -
      lly -
      urx -
      ury -
    • drawMultiLineOfText

      private void drawMultiLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      text -
      font -
      fontSize -
      llx -
      lly -
      urx -
      ury -
    • setCheckBoxParams

      private void setCheckBoxParams(PdfFormField field, String name, String value, boolean status, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      name -
      value -
      status -
      llx -
      lly -
      urx -
      ury -
    • drawCheckBoxAppearences

      private void drawCheckBoxAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      value -
      llx -
      lly -
      urx -
      ury -
    • drawRadioAppearences

      private void drawRadioAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      value -
      llx -
      lly -
      urx -
      ury -
    • setChoiceParams

      private void setChoiceParams(PdfFormField field, String name, String defaultValue, float llx, float lly, float urx, float ury)
      Parameters:
      field -
      name -
      defaultValue -
      llx -
      lly -
      urx -
      ury -