public final class Form extends Object implements Iterable<WidgetAnnotation>
Class representing form object.
Modifier and Type | Class and Description |
---|---|
static class |
Form.FlattenSettings
Class which describes settings for Form flattening procedure.
|
static class |
Form.SignDependentElementsRenderingModes
Forms can contain signing information and can be signed or unsigned.
|
Modifier and Type | Field and Description |
---|---|
int |
SignDependentElementsRenderingModeWhenConverted
Forms can contain signing information, i.e. can be signed or unsigned.
|
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.
|
boolean |
add(WidgetAnnotation field)
Adds field on the form.
|
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 |
clear()
Deletes all fields from form.
|
boolean |
contains(WidgetAnnotation field)
Determines if field is presented on form..
|
void |
copyTo(Field[] array,
int index)
Copies fields placed on the form into array.
|
void |
copyTo(WidgetAnnotation[] array,
int arrayIndex)
Copies form's fields to 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(int index) |
WidgetAnnotation |
get(String name)
Searches field by field name.
|
boolean |
getAutoRecalculate()
If set, all form fields will be recalculated when any field is changed.
|
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.
|
boolean |
getSignaturesAppendOnly()
If set, the document contains signatures that may be invalidated if the file is saved (written) in a way that alters its previous contents,
as opposed to an incremental update.
|
boolean |
getSignaturesExist()
If set, the document contains at least one signature field.
|
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 |
isReadOnly()
Determines if collection is readonly.
|
boolean |
isSynchronized()
Returns true if object is thread-safe.
|
Iterator<WidgetAnnotation> |
iterator()
Gets enumeration of form fields.
|
boolean |
remove(WidgetAnnotation field)
Deletes field from the form.
|
void |
setAutoRecalculate(boolean value)
If set, all form fields will be recalculated when any field is changed.
|
void |
setCalculatedFields(List<Field> value)
Allows to set order of field calculation.
|
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 |
setSignaturesAppendOnly(boolean value)
If set, the document contains signatures that may be invalidated if the file is saved (written) in a way that alters its previous contents,
as opposed to an incremental update.
|
void |
setSignaturesExist(boolean value)
If set, the document contains at least one signature field.
|
void |
setType(int value)
Gets type of the form.
|
int |
size()
Gets number of the fields on this form.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
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.
Form.SignDependentElementsRenderingModes
public Form(IDocument document)
document
- IDocument objectpublic IDocument getDocument()
public XFA get_xfa()
public boolean isSynchronized()
Returns true if object is thread-safe.
public Object getSyncRoot()
Returns synchronization object.
public final boolean getAutoRecalculate()
If set, all form fields will be recalculated when any field is changed. Default value is true. Set to false in order to increase performance when filling form with large amount of calculated fields.
public final void setAutoRecalculate(boolean value)
If set, all form fields will be recalculated when any field is changed. Default value is true. Set to false in order to increase performance when filling form with large amount of calculated fields.
value
- boolean valuepublic int size()
Gets number of the fields on this form.
public Resources getDefaultResources()
Gets default resources placed on this form.
public DefaultAppearance getDefaultAppearance()
Gets default appearance of the form (object which describes default font, text size and color for fields on the form).
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).
value
- DefaultAppearance objectpublic XFA getXFA()
Gets XFA data of the form (if presents).
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.
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.
value
- boolean valuepublic 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.
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.
value
- boolean valuepublic 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.
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.
value
- boolean valuepublic int getType()
Gets type of the form. Possible values are: Standard, Static, Dynamic.
FormType
public void setType(int value)
Gets type of the form. Possible values are: Standard, Static, Dynamic.
value
- FormType valueFormType
public void copyTo(Field[] array, int index)
Copies fields placed on the form into array.
array
- Array where fields must be placed.index
- Starting index.public Iterator<WidgetAnnotation> iterator()
Gets enumeration of form fields.
iterator
in interface Iterable<WidgetAnnotation>
public WidgetAnnotation get(String name)
Searches field by field name. Returns null if field was not found.
name
- Field name.public WidgetAnnotation get(int index)
public void add(Field field, int pageNumber)
Adds field on the form.
field
- Field which must be added.pageNumber
- Page index where added field will be placed.public void add(Field field)
Adds field on the form.
field
- Field which must be added.public void delete(Field field)
Delete field from the form.
field
- Field which must be deleted.public void delete(String fieldName)
Deletes field from the form by its name.
fieldName
- Name of the filed which must be deleted.public void flatten()
Removes all static form fields and place their values directly on the page.
public boolean add(WidgetAnnotation field)
Adds field on the form.
field
- Field which must be added.public void clear()
Deletes all fields from form. Not supported.
public boolean contains(WidgetAnnotation field)
Determines if field is presented on form..
field
- Field to search.public void copyTo(WidgetAnnotation[] array, int arrayIndex)
Copies form's fields to array.
array
- Array to copy.arrayIndex
- Index of array's item where copying begins.public boolean isReadOnly()
Determines if collection is readonly. Always returns false.
public boolean remove(WidgetAnnotation field)
Deletes field from the form.
field
- Field to delete.public WidgetAnnotation get_Item(String name)
Gets field of the form by field name. Throws excpetion if the field was not found.
name
- Name of the field.public WidgetAnnotation get_Item(int index)
Gets field of the form by field index.
index
- Index of the field.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.
field
- Field name.partialName
- Name of field on the form.pageNumber
- Page number where field will be added.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.
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.public void addFieldToAcroForm(Field field)
Adds additional appearance of the field to specified page of the document.
field
- Field objectpublic boolean hasXfa()
public void assignXfa(com.aspose.ms.System.Xml.XmlDocument xml)
Sets XFA of the form to specified value.
xml
- Xml document which concains new XFA data.public Field[] getFields()
Gets list of all fields in lowest level of hierarhical form.
public Field[] getFieldsInRect(Rectangle rect)
Returns fields inside of specified rectangle.
rect
- Rectangle where fields should be found.public void setCalculatedFields(List<Field> value)
value
- java.util.List object.public final boolean getSignaturesExist()
If set, the document contains at least one signature field.
public final void setSignaturesExist(boolean value)
If set, the document contains at least one signature field.
value
- boolean valuepublic final boolean getSignaturesAppendOnly()
If set, the document contains signatures that may be invalidated if the file is saved (written) in a way that alters its previous contents, as opposed to an incremental update.
public final void setSignaturesAppendOnly(boolean value)
If set, the document contains signatures that may be invalidated if the file is saved (written) in a way that alters its previous contents, as opposed to an incremental update.
value
- boolean value