Class PdfButtonFormField


public class PdfButtonFormField extends PdfFormField
An interactive control on the screen that raises events and/or can retain data.
  • Field Details

    • FF_NO_TOGGLE_TO_OFF

      public static final int FF_NO_TOGGLE_TO_OFF
      Button field flags
    • FF_RADIO

      public static final int FF_RADIO
    • FF_PUSH_BUTTON

      public static final int FF_PUSH_BUTTON
    • FF_RADIOS_IN_UNISON

      public static final int FF_RADIOS_IN_UNISON
  • Constructor Details

  • Method Details

    • getFormType

      public PdfName getFormType()
      Returns Btn, the form type for choice form fields.
      Overrides:
      getFormType in class PdfFormField
      Returns:
      the form type, as a PdfName
    • isRadio

      public boolean isRadio()
      If true, the field is a set of radio buttons; if false, the field is a check box. This flag only works if the Pushbutton flag is set to false.
      Returns:
      whether the field is currently radio buttons or a checkbox
    • setRadio

      public PdfButtonFormField setRadio (boolean radio)
      If true, the field is a set of radio buttons; if false, the field is a check box. This flag should be set only if the Pushbutton flag is set to false.
      Parameters:
      radio - whether the field should be radio buttons or a checkbox
      Returns:
      current PdfButtonFormField
    • isToggleOff

      public boolean isToggleOff()
      If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times. Only valid for radio buttons.
      Returns:
      whether a radio button currently allows to choose no options
    • setToggleOff

      public PdfButtonFormField setToggleOff (boolean toggleOff)
      If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times.
      Parameters:
      toggleOff - whether a radio button may allow to choose no options
      Returns:
      current PdfButtonFormField
    • isPushButton

      public boolean isPushButton()
      If true, the field is a pushbutton that does not retain a permanent value.
      Returns:
      whether or not the field is currently a pushbutton
    • setPushButton

      public PdfButtonFormField setPushButton (boolean pushButton)
      If true, the field is a pushbutton that does not retain a permanent value.
      Parameters:
      pushButton - whether or not to set the field to a pushbutton
      Returns:
      current PdfButtonFormField
    • isRadiosInUnison

      public boolean isRadiosInUnison()
      If true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If false, the buttons are mutually exclusive
      Returns:
      whether or not buttons are turned off in unison
    • setRadiosInUnison

      public PdfButtonFormField setRadiosInUnison (boolean radiosInUnison)
      If true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If false, the buttons are mutually exclusive
      Parameters:
      radiosInUnison - whether or not buttons should turn off in unison
      Returns:
      current PdfButtonFormField
    • setImage

      public PdfButtonFormField setImage (String image) throws IOException
      Throws:
      IOException
    • setImageAsForm

      public PdfButtonFormField setImageAsForm (PdfFormXObject form)