Field

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph, com.aspose.pdf.Annotation, com.aspose.pdf.WidgetAnnotation

All Implemented Interfaces: java.lang.Iterable, java.lang.Cloneable

public class Field extends WidgetAnnotation implements Iterable<WidgetAnnotation>, Cloneable

Base class for acro form fields.

Constructors

Constructor Description
Field(IDocument doc) Creates field for use in Generator.

Fields

Field Description
_Password _Password
_FileSelect _FileSelect

Methods

Method Description
getPartialName() Gets partial name of the field.
setPartialName(String value) Sets partial name of the field.
getAlternateName() Gets alternate name of the field (An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface).
setAlternateName(String value) Sets alternate name of the field (An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface).
getMappingName() Gets mapping name of the field that shall be used when exporting interactive form field data from the document.
setMappingName(String value) Sets mapping name of the field that shall be used when exporting interactive form field data from the document.
recalculate() Recaculates all calculated fields on the form.
getValue() Gets value of the field.
setValue(String value) Set value.
isSynchronized() Returns true if dictionary is synchronized.
size() Gets number of subfields in this field.
getSyncRoot() Synchronization object.
isGroup() Gets boolean value which indicates is this field non-terminal field i.e. group of fields.
copyTo(Field[] array, int index) Copies subfields of this field into array starting from specified index.
iterator() Returns enumerator of contained fields.
flatten() Removes this field and place its value directly on the page.
get_Item(String name) Gets subfield contained in this field by name of the subfield.
get_Item(int index) Gets subfield contained in this field by index.
setPosition(Point point) Set position of the field.
updateAppearances() Update appearances value.
getAnnotationIndex() Gets index of this anotation on the page.
setAnnotationIndex(int value) Sets index of this anotation on the page.
getPageIndex() Gets index of page which contains this field.
getRect() Gets the field rectangle.
setRect(Rectangle value) Sets the field rectangle.
isSharedField() Property for Generator support.
setSharedField(boolean value) Property for Generator support.
isFitIntoRectangle() If true then font size will reduced to fit text to specified rectangle.
setFitIntoRectangle(boolean value) If true then font size will reduced to fit text to specified rectangle.
getMaxFontSize() Maximal font size which can be used for field contents. -1 to don’t check size.
setMaxFontSize(double value) Maximal font size which can be used for field contents. -1 to don’t check size.
getMinFontSize() Minimal font size which can be used for field contents. -1 to don’t check size.
setMinFontSize(double value) Minimal font size which can be used for field contents. -1 to don’t check size.
getTabOrder() Gets or sets tab order of the field.
setTabOrder(int value) Gets or sets tab order of the field.
add(WidgetAnnotation item)
clear()
contains(WidgetAnnotation item)
copyTo(WidgetAnnotation[] array, int arrayIndex)
isReadOnly()
remove(WidgetAnnotation item)

Field(IDocument doc)

public Field(IDocument doc)

Creates field for use in Generator.

Parameters:

Parameter Type Description
doc IDocument Document where field will be created.

_Password

public static final int _Password

_Password

_FileSelect

public static final int _FileSelect

_FileSelect

getPartialName()

public String getPartialName()

Gets partial name of the field.

Returns: java.lang.String - String value

setPartialName(String value)

public void setPartialName(String value)

Sets partial name of the field.

Parameters:

Parameter Type Description
value java.lang.String String value

getAlternateName()

public String getAlternateName()

Gets alternate name of the field (An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface). Alternate name is used as field tooltip in Adobe Acrobat.

Returns: java.lang.String - String value

setAlternateName(String value)

public void setAlternateName(String value)

Sets alternate name of the field (An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface). Alternate name is used as field tooltip in Adobe Acrobat.

Parameters:

Parameter Type Description
value java.lang.String String value

getMappingName()

public String getMappingName()

Gets mapping name of the field that shall be used when exporting interactive form field data from the document.

Returns: java.lang.String - String value

setMappingName(String value)

public void setMappingName(String value)

Sets mapping name of the field that shall be used when exporting interactive form field data from the document.

Parameters:

Parameter Type Description
value java.lang.String String value

recalculate()

public boolean recalculate()

Recaculates all calculated fields on the form.

Returns: boolean - true if field value was changed during recalculation.

getValue()

public String getValue()

Gets value of the field.

Returns: java.lang.String - String value

setValue(String value)

public void setValue(String value)

Set value.

Parameters:

Parameter Type Description
value java.lang.String String value

isSynchronized()

public boolean isSynchronized()

Returns true if dictionary is synchronized.

Returns: boolean - boolean value

size()

public int size()

Gets number of subfields in this field. (For example number of items in radio button field).

Returns: int - int value

getSyncRoot()

public Object getSyncRoot()

Synchronization object.

Returns: java.lang.Object - object value

isGroup()

public boolean isGroup()

Gets boolean value which indicates is this field non-terminal field i.e. group of fields.

Returns: boolean - boolean value

copyTo(Field[] array, int index)

public void copyTo(Field[] array, int index)

Copies subfields of this field into array starting from specified index.

Parameters:

Parameter Type Description
array Field[] Array where field must be copied.
index int Starting index where fields will be copied.

iterator()

public Iterator<WidgetAnnotation> iterator()

Returns enumerator of contained fields.

Returns: java.util.Iterator<com.aspose.pdf.WidgetAnnotation> - Enumerator object.

flatten()

public void flatten()

Removes this field and place its value directly on the page.

get_Item(String name)

public WidgetAnnotation get_Item(String name)

Gets subfield contained in this field by name of the subfield.

Parameters:

Parameter Type Description
name java.lang.String Contained subfield name.

Returns: WidgetAnnotation - Field instance.

get_Item(int index)

public WidgetAnnotation get_Item(int index)

Gets subfield contained in this field by index.

Parameters:

Parameter Type Description
index int Index of the reuqested subfield.

Returns: WidgetAnnotation - Field instance.

setPosition(Point point)

public void setPosition(Point point)

Set position of the field.

Parameters:

Parameter Type Description
point Point Point where field should be positioned.

updateAppearances()

public void updateAppearances()

Update appearances value.

getAnnotationIndex()

public int getAnnotationIndex()

Gets index of this anotation on the page.

Returns: int - int value

setAnnotationIndex(int value)

public void setAnnotationIndex(int value)

Sets index of this anotation on the page.

Parameters:

Parameter Type Description
value int int value

getPageIndex()

public int getPageIndex()

Gets index of page which contains this field.

Returns: int - int value

getRect()

public Rectangle getRect()

Gets the field rectangle.

Returns: Rectangle - the field rectangle.

setRect(Rectangle value)

public void setRect(Rectangle value)

Sets the field rectangle.

Parameters:

Parameter Type Description
value Rectangle the field rectangle.

isSharedField()

public boolean isSharedField()

Property for Generator support. Used when field is added to header or footer. If true, this field will created once and it’s appearance will be visible on all pages of the document. If false, separated field will be created for every document page.

Returns: boolean - boolean value

setSharedField(boolean value)

public void setSharedField(boolean value)

Property for Generator support. Used when field is added to header or footer. If true, this field will created once and it’s appearance will be visible on all pages of the document. If false, separated field will be created for every document page.

Parameters:

Parameter Type Description
value boolean boolean value

isFitIntoRectangle()

public static synchronized boolean isFitIntoRectangle()

If true then font size will reduced to fit text to specified rectangle.

Returns: boolean - boolean value

setFitIntoRectangle(boolean value)

public static synchronized void setFitIntoRectangle(boolean value)

If true then font size will reduced to fit text to specified rectangle.

Parameters:

Parameter Type Description
value boolean boolean value

getMaxFontSize()

public static synchronized double getMaxFontSize()

Maximal font size which can be used for field contents. -1 to don’t check size.

Returns: double - double value

setMaxFontSize(double value)

public static synchronized void setMaxFontSize(double value)

Maximal font size which can be used for field contents. -1 to don’t check size.

Parameters:

Parameter Type Description
value double double value

getMinFontSize()

public static double getMinFontSize()

Minimal font size which can be used for field contents. -1 to don’t check size.

Returns: double - double value

setMinFontSize(double value)

public static void setMinFontSize(double value)

Minimal font size which can be used for field contents. -1 to don’t check size.

Parameters:

Parameter Type Description
value double double value

getTabOrder()

public int getTabOrder()

Gets or sets tab order of the field.

Returns: int - int value

setTabOrder(int value)

public void setTabOrder(int value)

Gets or sets tab order of the field.

Parameters:

Parameter Type Description
value int int value

add(WidgetAnnotation item)

public void add(WidgetAnnotation item)

Parameters:

Parameter Type Description
item WidgetAnnotation

clear()

public void clear()

contains(WidgetAnnotation item)

public boolean contains(WidgetAnnotation item)

Parameters:

Parameter Type Description
item WidgetAnnotation

Returns: boolean

copyTo(WidgetAnnotation[] array, int arrayIndex)

public void copyTo(WidgetAnnotation[] array, int arrayIndex)

Parameters:

Parameter Type Description
array WidgetAnnotation[]
arrayIndex int

isReadOnly()

public boolean isReadOnly()

Returns: boolean

remove(WidgetAnnotation item)

public boolean remove(WidgetAnnotation item)

Parameters:

Parameter Type Description
item WidgetAnnotation

Returns: boolean