aspose.pdf
Class FormField

java.lang.Object
  extended by aspose.pdf.Paragraph
      extended by aspose.pdf.FormField

public class FormField
extends Paragraph

Represents a formfield Paragraph in the Pdf document.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); FormField combo = new FormField(); combo.setFormFieldType(FormFieldType.Combo); combo.setFieldName("ACombo"); combo.setChoiceOptions(new String[]{"Red","Green","Blue"}); combo.setFieldValue("Red"); combo.setFormWidth(80); combo.setFormHeight(20); sec1.getParagraphs().add(combo); pdf1.Save(...); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <FormField FormFieldType="Combo" FieldName="ACombo" FieldValue="Red" ChoiceOptions="Red Green Blue" FormWidth="80" FormHeight="20" /> </Section> </Pdf>


Nested Class Summary
 
Nested classes/interfaces inherited from class aspose.pdf.Paragraph
Paragraph.VerticalPositionInfo
 
Field Summary
 int Flag
           
 boolean isWidthSet
           
 
Fields inherited from class aspose.pdf.Paragraph
isNeedAddToPage, isPositionProcessed, RealPageNumber, VerticalPosInfo
 
Constructor Summary
FormField()
          Constructor - initializes a new instance of the FormField class.
 
Method Summary
 java.awt.Color getBackgroundColor()
          Gets a Color object that indicates the color of the background.
 java.awt.Color getBorderColor()
          Gets a Color object.
 java.awt.Color getButtonColor()
          Gets a Color object that indicates the color of the button.
 boolean getCheckBoxIsChecked()
          Gets a boolean value that indicates whether the checkbox is checked.
 java.lang.String[] getChoiceOptions()
          Gets a string array that indicates the options of combo or list field.
 int[] getChoiceSelections()
          Gets an int array that indicates the choice selection indexes.
 boolean getComboIsEditable()
          Gets a boolean value that indicates whether the combo is editable.
 java.lang.String getFieldName()
          Gets a string that indicates the name of the field.
 java.lang.String getFieldValue()
          Gets a string that indicates the value of the field.
 FormFieldType getFormFieldType()
          Gets a FormFieldType enumeration that indicates the formfield type.
 float getFormHeight()
          Gets a float value that indicates the height of the formfield.
 float getFormWidth()
          Gets a float value that indicates the width of the formfield.
 Segment getInlineSeg()
          Gets the inline Segment object.
 Text getInWhichText()
          Gets a Text object that this form field lies in.
 boolean getIsBordered()
          Gets a boolean value that indicates whether the text field is bordered.
 boolean getIsMultiSelect()
          Gets a boolean value that indicates if multiple selecting is allowed.
 boolean getIsReadOnly()
          Gets a boolean value that indicates if the field is read only.
 boolean getIsSizeSet()
          Sets a boolean value that indicates whether size has been set.
 int getRadioButtonCheckedIndex()
          Gets an int value that indicates the index of the radiobutton that has been checked.
 RadioButtons getRadioButtons()
          Gets a RadioButtons collection that indicates the radiobuttons in this field.
 java.awt.Color getTextColor()
          Gets a Color object that indicates the color of the text field.
 java.lang.String getTextFontName()
          Gets a string that indicates the font name of the text field.
 float getTextFontSize()
          Gets a float value that indicates the font size of the text field.
 boolean getTextIsMultiLine()
          Gets a boolean value that indicate whether the text field can be multiline.
 boolean getTextIsPassword()
          Gets a boolean value that indicates whether the text field is password.
 int getTextMaxLength()
          Gets an int value that indicates the max length of the text can be entered in this field.
 int getTopIndex()
          Gets an int value that indicates the top index (in the options array) of combo or list field.
 void setBackgroundColor(java.awt.Color value)
          Sets a Color object.
 void setBorderColor(java.awt.Color value)
          Sets a Color object that indicates the color of the border.
 void setButtonColor(java.awt.Color value)
          Sets a Color object that indicates the color of the button.
 void setCheckBoxIsChecked(boolean value)
          Sets a bool value that indicates whether the checkbox is checked.
 void setChoiceOptions(java.lang.String[] value)
          Sets a string array that indicates the options of combo or list field.
 void setChoiceSelections(int[] value)
          Sets an int array that indicates the choice selection indexes.
 void setComboIsEditable(boolean value)
          Sets a boolean value that indicates whether the combo is editable.
 void setFieldName(java.lang.String value)
          Sets a string that indicates the name of the field.
 void setFieldValue(java.lang.String value)
          Sets a string that indicates the value of the field.
 void setFormFieldType(FormFieldType value)
          Sets a FormFieldType enumeration that indicates the formfield type.
 void setFormHeight(float value)
          Sets a float value that indicates the height of the formfield.
 void setFormWidth(float value)
          Sets a float value that indicates the width of the formfield.
 void setInlineSeg(Segment value)
          Sets the inline Segment object.
 void setInWhichText(Text value)
          Sets a Text object that this form field lies in.
 void setIsBordered(boolean value)
          Sets a booleab value that indicates whether the text field is bordered.
 void setIsMultiSelect(boolean value)
          Sets a boolean value that indicates if multiple selecting is allowed.
 void setIsReadOnly(boolean value)
          Sets a boolean value that indicates if the field is read only.
 void setRadioButtonCheckedIndex(int value)
          Sets an int value that indicates the index of the radiobutton that has been checked.
 void setRadioButtons(RadioButtons value)
          Sets a RadioButtons collection that indicates the radiobuttons in this field.
 void setTextColor(java.awt.Color value)
          Sets a Color object.
 void setTextFontName(java.lang.String value)
          Sets a string that indicates the font name of the text field.
 void setTextFontSize(float value)
          Sets a float value that indicates the font size of the text field.
 void setTextIsMultiLine(boolean value)
          Sets a boolean value that indicate whether the text field can be multiline.
 void setTextIsPassword(boolean value)
          Sets a boolean value that indicates whether the text field is password.
 void setTextMaxLength(int value)
          Sets an int value that indicates the max length of the text can be entered in this field.
 void setTopIndex(int value)
          Sets an int value that indicates the top index (in the options array) of combo or list field.
 
Methods inherited from class aspose.pdf.Paragraph
getHeight, getID, getIsNeedAddToPage, getIsPositionGot, getIsPositionProcessed, getLeft, getMargin, getMayNeedReprocess, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferenceParagraphID, getRefPara, getSection, getTop, getVerticalPosInfo, getWidth, isDisabled, isEndNote, isFirstParagraph, isFirstParagraphInColumn, isFootNote, isFootNoteProcessed, isInHeaderFooter, isInList, isKeptTogether, isKeptWithNext, isOnOddPage, setEndNote, setFootNoteProcessed, setHeight, setID, setIsDisabled, setIsFirstParagraph, setIsFirstParagraphInColumn, setIsFootNote, setIsInHeaderFooter, setIsInList, setIsKeptTogether, setIsKeptWithNext, setIsNeedAddToPage, setIsOnOddPage, setIsPositionGot, setIsPositionProcessed, setLeft, setMargin, setMayNeedReprocess, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferenceParagraphID, setRefPara, setSection, setTop, setVerticalPosInfo, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isWidthSet

public boolean isWidthSet

Flag

public int Flag
Constructor Detail

FormField

public FormField()
Constructor - initializes a new instance of the FormField class.

Method Detail

getFormFieldType

public FormFieldType getFormFieldType()
Gets a FormFieldType enumeration that indicates the formfield type.

Returns:
A FormFieldType object.

setFormFieldType

public void setFormFieldType(FormFieldType value)
Sets a FormFieldType enumeration that indicates the formfield type.

Parameters:
value - A FormFieldType object.

getComboIsEditable

public boolean getComboIsEditable()
Gets a boolean value that indicates whether the combo is editable. Default value is true.

Returns:
A booleam value.

setComboIsEditable

public void setComboIsEditable(boolean value)
Sets a boolean value that indicates whether the combo is editable. Default value is true.

Parameters:
value - A boolean value.

getChoiceOptions

public java.lang.String[] getChoiceOptions()
Gets a string array that indicates the options of combo or list field.

Returns:
A String list.

setChoiceOptions

public void setChoiceOptions(java.lang.String[] value)
Sets a string array that indicates the options of combo or list field.

Parameters:
value - A String list.

getChoiceSelections

public int[] getChoiceSelections()
Gets an int array that indicates the choice selection indexes.

Returns:
An int list.

setChoiceSelections

public void setChoiceSelections(int[] value)
Sets an int array that indicates the choice selection indexes.

Parameters:
value - An int list.

getTopIndex

public int getTopIndex()
Gets an int value that indicates the top index (in the options array) of combo or list field. Default is 0.

Returns:
An int value.

setTopIndex

public void setTopIndex(int value)
Sets an int value that indicates the top index (in the options array) of combo or list field. Default is 0.

Parameters:
value - An int value.

getFieldName

public java.lang.String getFieldName()
Gets a string that indicates the name of the field. Note that each field MUST have a unique name.

Returns:
A String value.

setFieldName

public void setFieldName(java.lang.String value)
Sets a string that indicates the name of the field. Note that each field MUST have a unique name.

Parameters:
value - A String value.

getFieldValue

public java.lang.String getFieldValue()
Gets a string that indicates the value of the field.

Returns:
A String value.

setFieldValue

public void setFieldValue(java.lang.String value)
Sets a string that indicates the value of the field.

Parameters:
value - A String value.

getFormWidth

public float getFormWidth()
Gets a float value that indicates the width of the formfield. Default value is 100 points.

Returns:
A float value.

setFormWidth

public void setFormWidth(float value)
Sets a float value that indicates the width of the formfield. Default value is 100 points.

Parameters:
value - A float value.

getFormHeight

public float getFormHeight()
Gets a float value that indicates the height of the formfield. Default value is 30 points.

Returns:
A float value.

setFormHeight

public void setFormHeight(float value)
Sets a float value that indicates the height of the formfield. Default value is 30 points.

Parameters:
value - A float value.

getCheckBoxIsChecked

public boolean getCheckBoxIsChecked()
Gets a boolean value that indicates whether the checkbox is checked. Default is false.

Returns:
A boolean value.

setCheckBoxIsChecked

public void setCheckBoxIsChecked(boolean value)
Sets a bool value that indicates whether the checkbox is checked. Default is false.

Parameters:
value - A boolen value.

getTextFontName

public java.lang.String getTextFontName()
Gets a string that indicates the font name of the text field. The core fonts (Courier,Courier-Bold,Courier-BoldOblique,Courier-Oblique,Helvetica,Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,Symbol,Times-Bold,Times-BoldItalic,Times-Italic, Times-Roman and ZapfDingbats) and Truetype fonts are supported. When using Truetype font, you should use the font family name. If you want the font be bold or italic, set the font name like "Arial,Bold","Arial,Italic" or "Arial,BoldItalic".

Returns:
Font name.

setTextFontName

public void setTextFontName(java.lang.String value)
Sets a string that indicates the font name of the text field. The core fonts (Courier,Courier-Bold,Courier-BoldOblique,Courier-Oblique,Helvetica,Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,Symbol,Times-Bold,Times-BoldItalic,Times-Italic, Times-Roman and ZapfDingbats) and Truetype fonts are supported. When using Truetype font, you should use the font family name. If you want the font be bold or italic, set the font name like "Arial,Bold","Arial,Italic" or "Arial,BoldItalic".

Parameters:
value - Font name.

getTextColor

public java.awt.Color getTextColor()
Gets a Color object that indicates the color of the text field.

Returns:
A Color object

setTextColor

public void setTextColor(java.awt.Color value)
Sets a Color object. object that indicates the color of the text field.

Parameters:
value - A Color object.

getBackgroundColor

public java.awt.Color getBackgroundColor()
Gets a Color object that indicates the color of the background.

Returns:
A Color object.

setBackgroundColor

public void setBackgroundColor(java.awt.Color value)
Sets a Color object. object that indicates the color of the background.

Parameters:
value - A Color object.

getBorderColor

public java.awt.Color getBorderColor()
Gets a Color object. object that indicates the color of the border.

Returns:
A Color object.

setBorderColor

public void setBorderColor(java.awt.Color value)
Sets a Color object that indicates the color of the border.

Parameters:
value - A Color object.

getButtonColor

public java.awt.Color getButtonColor()
Gets a Color object that indicates the color of the button.

Returns:
A Color object.

setButtonColor

public void setButtonColor(java.awt.Color value)
Sets a Color object that indicates the color of the button.

Parameters:
value - A Color object.

getTextFontSize

public float getTextFontSize()
Gets a float value that indicates the font size of the text field. Default is 14 points.

Returns:
A float value.

setTextFontSize

public void setTextFontSize(float value)
Sets a float value that indicates the font size of the text field. Default is 14 points.

Parameters:
value - A float value.

getTextIsMultiLine

public boolean getTextIsMultiLine()
Gets a boolean value that indicate whether the text field can be multiline. Default is false.

Returns:
A boolean value.

setTextIsMultiLine

public void setTextIsMultiLine(boolean value)
Sets a boolean value that indicate whether the text field can be multiline. Default is false.

Parameters:
value - A boolean value.

getTextIsPassword

public boolean getTextIsPassword()
Gets a boolean value that indicates whether the text field is password. If set to true, the field is intended for entering a secure password that should not be echoed visibly to the screen. Default value is false.

Returns:
A boolean value.

setTextIsPassword

public void setTextIsPassword(boolean value)
Sets a boolean value that indicates whether the text field is password. If set to true, the field is intended for entering a secure password that should not be echoed visibly to the screen. Default value is false.

Parameters:
value - A boolean value.

getTextMaxLength

public int getTextMaxLength()
Gets an int value that indicates the max length of the text can be entered in this field.

Returns:
An int value.

setTextMaxLength

public void setTextMaxLength(int value)
Sets an int value that indicates the max length of the text can be entered in this field.

Parameters:
value - An int value.

getIsBordered

public boolean getIsBordered()
Gets a boolean value that indicates whether the text field is bordered. Default is false.

Returns:
A boolean value.

setIsBordered

public void setIsBordered(boolean value)
Sets a booleab value that indicates whether the text field is bordered. Default is false.

Parameters:
value - A boolean value.

getRadioButtons

public RadioButtons getRadioButtons()
Gets a RadioButtons collection that indicates the radiobuttons in this field.

Returns:
A RadioButtons object.

setRadioButtons

public void setRadioButtons(RadioButtons value)
Sets a RadioButtons collection that indicates the radiobuttons in this field.

Parameters:
value - A RadioButtons object.

getRadioButtonCheckedIndex

public int getRadioButtonCheckedIndex()
Gets an int value that indicates the index of the radiobutton that has been checked.

Returns:
An int value.

setRadioButtonCheckedIndex

public void setRadioButtonCheckedIndex(int value)
Sets an int value that indicates the index of the radiobutton that has been checked.

Parameters:
value - An int value.

getIsReadOnly

public boolean getIsReadOnly()
Gets a boolean value that indicates if the field is read only.

Returns:
A boolean value.

setIsReadOnly

public void setIsReadOnly(boolean value)
Sets a boolean value that indicates if the field is read only.

Parameters:
value - A boolean value.

getIsMultiSelect

public boolean getIsMultiSelect()
Gets a boolean value that indicates if multiple selecting is allowed.

Returns:
A boolean value.

setIsMultiSelect

public void setIsMultiSelect(boolean value)
Sets a boolean value that indicates if multiple selecting is allowed.

Parameters:
value - A boolean value.

getIsSizeSet

public boolean getIsSizeSet()
Sets a boolean value that indicates whether size has been set.

Returns:
A boolean value.

getInWhichText

public Text getInWhichText()
Gets a Text object that this form field lies in.

Returns:
a Text object.

setInWhichText

public void setInWhichText(Text value)
Sets a Text object that this form field lies in.

Parameters:
value - An Text object.

getInlineSeg

public Segment getInlineSeg()
Gets the inline Segment object.

Returns:
a Segment object.

setInlineSeg

public void setInlineSeg(Segment value)
Sets the inline Segment object.

Parameters:
value - A Segment object.