Class Field

    • Method Detail

      • addNewWidget

        public Widget addNewWidget​(Rectangle boundingBox)

        Create a new widget and add to the form field

        This method creates a widget for the form field. The widget is automatically added to the field's widgets, but not to any page. This method does not work for radio button form fields; Use RadioButton.addNewWidget(com.pdf_tools.fourheights.pdftoolbox.geometry.real.Rectangle).
        Parameters:
        boundingBox - The widget's target rectangle on the page
        Returns:
        the newly created form field widget
        Throws:
        java.lang.IllegalStateException - if the document has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only
        java.lang.UnsupportedOperationException - if the form field is of type RadioButtonGroup
        java.lang.IllegalArgumentException - if boundingBox is null
      • getWidgets

        public WidgetList getWidgets()

        This form field's widget annotations (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • getReadOnly

        public boolean getReadOnly()

        Flags this field as read-only (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • setReadOnly

        public void setReadOnly​(boolean value)

        Flags this field as read-only (Setter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only
      • getRequired

        public boolean getRequired()

        Flags this field as mandatory (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • setRequired

        public void setRequired​(boolean value)

        Flags this field as mandatory (Setter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only
      • getDoNotExport

        public boolean getDoNotExport()

        Tells whether this field is exported (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • setDoNotExport

        public void setDoNotExport​(boolean value)

        Tells whether this field is exported (Setter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only