com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class Form

  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.ICollection, com.aspose.ms.System.Collections.IEnumerable, Iterable


    public final class Form
    extends Object
    implements com.aspose.ms.System.Collections.ICollection

    Class representing form object.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Form(IDocument document)
      Constructor
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(Field field)
      Adds field on the form.
      void add(Field field, int pageNumber)
      Adds field on the form.
      Field add(Field field, String partialName, int pageNumber)
      Adds new field to the form; If this field is already placed on other or this form, the copy of field is created.
      void addFieldAppearance(Field field, int pageNumber, Rectangle rect)
      Adds additional appearance of the field to specified page of the document in the specified location.
      void addFieldToAcroForm(Field field)
      Adds additional appearance of the field to specified page of the document.
      void assignXfa(com.aspose.ms.System.Xml.XmlDocument xml)
      Sets XFA of the form to specified value.
      void copyTo(com.aspose.ms.System.Array array, int index)
      Copies fields placed on the form into array.
      void delete(Field field)
      Delete field from the form.
      void delete(String fieldName)
      Deletes field from the form by its name.
      void flatten()
      Removes all static form fields and place their values directly on the page.
      WidgetAnnotation get_Item(int index)
      Gets field of the form by field index.
      WidgetAnnotation get_Item(String name)
      Gets field of the form by field name.
      XFA get_xfa()
      For internal usage only
      WidgetAnnotation get(String name)
      Searches field by field name.
      DefaultAppearance getDefaultAppearance()
      Gets default appearance of the form (object which describes default font, text size and color for fields on the form).
      Resources getDefaultResources()
      Gets default resources placed on this form.
      IDocument getDocument()
      For internal usage only
      boolean getEmulateRequierdGroups()
      If this property is true then additional red boundary rectangles will be drawn for required Xfa exclGroup elements containers This property was introduced because absences of analogies for the exclGroup during conversion Xfa representation of forms to standard.
      Field[] getFields()
      Gets list of all fields in lowest level of hierarhical form.
      Field[] getFieldsInRect(Rectangle rect)
      Returns fields inside of specified rectangle.
      boolean getIgnoreNeedsRendering()
      If this property is true the value of NeedsRendering key will be ignored during conversion XFA form to Standard form.
      boolean getRemovePermission()
      If this property is true the "Perms" dictionary will be removed from the pdf document after conversion dynamic documents to standard.
      Object getSyncRoot()
      Returns synchronization object.
      int getType()
      Gets type of the form.
      XFA getXFA()
      Gets XFA data of the form (if presents).
      boolean hasXfa()
      Returns true if hasXfa
      boolean isSynchronized()
      Returns true if object is thread-safe.
      com.aspose.ms.System.Collections.IEnumerator iterator()
      Gets enumeration of form fields.
      void setDefaultAppearance(DefaultAppearance value)
      Sets default appearance of the form (object which describes default font, text size and color for fields on the form).
      void setEmulateRequierdGroups(boolean value)
      If this property is true then additional red boundary rectangles will be drawn for required Xfa exclGroup elements containers This property was introduced because absences of analogies for the exclGroup during conversion Xfa representation of forms to standard.
      void setIgnoreNeedsRendering(boolean value)
      If this property is true the value of NeedsRendering key will be ignored during conversion XFA form to Standard form.
      void setRemovePermission(boolean value)
      If this property is true the "Perms" dictionary will be removed from the pdf document after conversion dynamic documents to standard.
      void setType(int value)
      Gets type of the form.
      int size()
      Gets number of the fields on this form.
    • Field Detail

      • SignDependentElementsRenderingModeWhenConverted

        public int SignDependentElementsRenderingModeWhenConverted

        Forms can contain signing information, i.e. can be signed or unsigned. And form's view sometimes must depend on whether form is signed or not. This property tells to form's converter (f.e. during conversion XFA form to Standard form) whether result form must be rendered as signed or as unsigned.

        See Also:
        Form.SignDependentElementsRenderingModes
    • Constructor Detail

      • Form

        public Form(IDocument document)
        Constructor
        Parameters:
        document - IDocument object
    • Method Detail

      • getDocument

        public IDocument getDocument()
        For internal usage only
        Returns:
        IDocument object
      • get_xfa

        public XFA get_xfa()
        For internal usage only
        Returns:
        XFA object
      • isSynchronized

        public boolean isSynchronized()

        Returns true if object is thread-safe.

        Specified by:
        isSynchronized in interface com.aspose.ms.System.Collections.ICollection
        Returns:
        boolean value
      • getSyncRoot

        public Object getSyncRoot()

        Returns synchronization object.

        Specified by:
        getSyncRoot in interface com.aspose.ms.System.Collections.ICollection
        Returns:
        Object for synchronization
      • size

        public int size()

        Gets number of the fields on this form.

        Specified by:
        size in interface com.aspose.ms.System.Collections.ICollection
        Returns:
        int value
      • getDefaultResources

        public Resources getDefaultResources()

        Gets default resources placed on this form.

        Returns:
        Resources value
      • getDefaultAppearance

        public DefaultAppearance getDefaultAppearance()

        Gets default appearance of the form (object which describes default font, text size and color for fields on the form).

        Returns:
        DefaultAppearance object
      • setDefaultAppearance

        public void setDefaultAppearance(DefaultAppearance value)

        Sets default appearance of the form (object which describes default font, text size and color for fields on the form).

        Parameters:
        value - DefaultAppearance object
      • getXFA

        public XFA getXFA()

        Gets XFA data of the form (if presents).

        Returns:
        XFA value
      • getIgnoreNeedsRendering

        public boolean getIgnoreNeedsRendering()

        If this property is true the value of NeedsRendering key will be ignored during conversion XFA form to Standard form. It is false by default.

        Returns:
        boolean value
      • setIgnoreNeedsRendering

        public void setIgnoreNeedsRendering(boolean value)

        If this property is true the value of NeedsRendering key will be ignored during conversion XFA form to Standard form. It is false by default.

        Parameters:
        value - boolean value
      • getRemovePermission

        public boolean getRemovePermission()

        If this property is true the "Perms" dictionary will be removed from the pdf document after conversion dynamic documents to standard. The "Perms" dictionary can contain a rules that disturb displaying selection of mandatory fields in Adobe Acrobat reader. It is false by default.

        Returns:
        boolean value
      • setRemovePermission

        public void setRemovePermission(boolean value)

        If this property is true the "Perms" dictionary will be removed from the pdf document after conversion dynamic documents to standard. The "Perms" dictionary can contain a rules that disturb displaying selection of mandatory fields in Adobe Acrobat reader. It is false by default.

        Parameters:
        value - boolean value
      • getEmulateRequierdGroups

        public boolean getEmulateRequierdGroups()

        If this property is true then additional red boundary rectangles will be drawn for required Xfa exclGroup elements containers This property was introduced because absences of analogies for the exclGroup during conversion Xfa representation of forms to standard. It is false by default.

        Returns:
        boolean value
      • setEmulateRequierdGroups

        public void setEmulateRequierdGroups(boolean value)

        If this property is true then additional red boundary rectangles will be drawn for required Xfa exclGroup elements containers This property was introduced because absences of analogies for the exclGroup during conversion Xfa representation of forms to standard. It is false by default.

        Parameters:
        value - boolean value
      • getType

        public int getType()

        Gets type of the form. Possible values are: Standard, Static, Dynamic.

        Returns:
        FormType value
        See Also:
        FormType
      • setType

        public void setType(int value)

        Gets type of the form. Possible values are: Standard, Static, Dynamic.

        Parameters:
        value - FormType value
        See Also:
        FormType
      • copyTo

        public void copyTo(com.aspose.ms.System.Array array,
                  int index)

        Copies fields placed on the form into array.

        Specified by:
        copyTo in interface com.aspose.ms.System.Collections.ICollection
        Parameters:
        array - Array where fields must be placed.
        index - Starting index.
      • iterator

        public com.aspose.ms.System.Collections.IEnumerator iterator()

        Gets enumeration of form fields.

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable
        Specified by:
        iterator in interface Iterable
        Returns:
        Field enumerator.
      • get

        public WidgetAnnotation get(String name)

        Searches field by field name. Returns null if field was not found.

        Parameters:
        name - Field name.
        Returns:
        Field object.
      • add

        public void add(Field field,
               int pageNumber)

        Adds field on the form.

        Parameters:
        field - Field which must be added.
        pageNumber - Page index where added field will be placed.
      • add

        public void add(Field field)

        Adds field on the form.

        Parameters:
        field - Field which must be added.
      • delete

        public void delete(Field field)

        Delete field from the form.

        Parameters:
        field - Field which must be deleted.
      • delete

        public void delete(String fieldName)

        Deletes field from the form by its name.

        Parameters:
        fieldName - Name of the filed which must be deleted.
      • flatten

        public void flatten()

        Removes all static form fields and place their values directly on the page.

      • get_Item

        public WidgetAnnotation get_Item(String name)

        Gets field of the form by field name. Throws excpetion if the field was not found.

        Parameters:
        name - Name of the field.
        Returns:
        Retreived field.
      • get_Item

        public WidgetAnnotation get_Item(int index)

        Gets field of the form by field index.

        Parameters:
        index - Index of the field.
        Returns:
        Retreived field.
      • add

        public Field add(Field field,
                String partialName,
                int pageNumber)

        Adds new field to the form; If this field is already placed on other or this form, the copy of field is created.

        Parameters:
        field - Field name.
        partialName - Name of field on the form.
        pageNumber - Page number where field will be added.
        Returns:
        Added field returned. If copy of the field was created it will be returned.
      • addFieldAppearance

        public void addFieldAppearance(Field field,
                              int pageNumber,
                              Rectangle rect)

        Adds additional appearance of the field to specified page of the document in the specified location.

        Parameters:
        field - Field which appearance should be added on form.
        pageNumber - Number of the page where field must be placed.
        rect - Rectangle where field will be placed.
      • addFieldToAcroForm

        public void addFieldToAcroForm(Field field)

        Adds additional appearance of the field to specified page of the document.

        Parameters:
        field - Field object
      • hasXfa

        public boolean hasXfa()
        Returns true if hasXfa
        Returns:
        boolean value
      • assignXfa

        public void assignXfa(com.aspose.ms.System.Xml.XmlDocument xml)

        Sets XFA of the form to specified value.

        Parameters:
        xml - Xml document which concains new XFA data.
      • getFields

        public Field[] getFields()

        Gets list of all fields in lowest level of hierarhical form.

        Returns:
        Array with found fields.
      • getFieldsInRect

        public Field[] getFieldsInRect(Rectangle rect)

        Returns fields inside of specified rectangle.

        Parameters:
        rect - Rectangle where fields should be found.
        Returns:
        Array with found fields.