public class FormField extends Paragraph
Represents a formfield Paragraph
in the Pdf document.
[Java] //Create pdf document Pdf pdf1 = new Pdf(); //Add a section into the pdf document aspose.pdf.generator.Section Section1 = pdf1.getSections().add(); //Create a new FormField object FormField ComboBox1 = new FormField(); // Set the formfield type to Combo box ComboBox1.FormFieldType = FormFieldType.Combo; // set field name ComboBox1.setFieldName ( "ACombo"); // Specify combo box option values ComboBox1.setChoiceOptions ( new String[] { "Red", "Green", "Blue" }); // specify the combo field value to be selected as default ComboBox1.setFieldValue ( "Green"); // set the form fielf widht ComboBox1.setFormWidth ( 80); // set form field height ComboBox1.setFormHeight ( 20); //Add ComboBox to Paragraphs collection of section object Section1.getParagraphs().add(ComboBox1); //Save the pdf document pdf1.save("D:\\pdftest\\FormFieldTest_code.pdf"); [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>
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.System.Drawing.Color |
BackgroundColor
Gets or sets a
System.Drawing.Color object that indicates the color of the background. |
com.aspose.ms.System.Drawing.Color |
BorderColor
Gets or sets a
System.Drawing.Color object that indicates the color of the border. |
com.aspose.ms.System.Drawing.Color |
ButtonColor
Gets or sets a
System.Drawing.Color object that indicates the color of the button. |
boolean |
CheckBoxIsChecked
Gets or sets a bool value that indicates whether the checkbox is checked.
|
String[] |
ChoiceOptions
Gets or sets a string array that indicates the options of combo or list field.
|
int[] |
ChoiceSelections
Gets or sets a int array that indicates the choice selection indexes.
|
boolean |
ComboIsEditable
Gets or sets a bool value that indicates whether the combo is editable.
|
String |
FieldName
Gets or sets a string that indicates the name of the field.
|
float |
FormHeight
Gets or sets a float value that indicates the height of the formfield.
|
float |
FormWidth
Gets or sets a float value that indicates the width of the formfield.
|
boolean |
IsBordered
Gets or sets a bool value that indicates whether the text field is bordered.
|
boolean |
IsMultiSelect
Gets or sets a bool value that indicates if multi-selecting is allowed.
|
boolean |
IsReadOnly
Gets or sets a bool value that indicates if the field is readonly.
|
int |
RadioButtonCheckedIndex
Gets or sets a int value that indicates the index of the radiobutton that has been checked.
|
RadioButtons |
RadioButtons
Gets or sets a
RadioButtons collection that indicates the radiobuttons in this field. |
com.aspose.ms.System.Drawing.Color |
TextColor
Gets or sets a
System.Drawing.Color object that indicates the color of the text field. |
String |
TextFontName
Gets or sets a string that indicates the font name of the text field.
|
float |
TextFontSize
Gets or sets a float value that indicates the font size of the text field.
|
boolean |
TextIsMultiLine
Gets or sets a bool value that indicate whether the text field can be multiline.
|
boolean |
TextIsPassword
Gets or sets a bool value that indicates whether the text field is password.
|
int |
TextMaxLength
Gets or sets a int value that indicates the max length of the text can be entered in this field.
|
_PositioningType, FixedHeight, FixedWidth, ID, IsDisabled, IsFirstParagraph, IsFirstParagraphInColumn, IsInList, IsKeptTogether, IsKeptWithNext, IsOnOddPage, Left, Margin, ReferenceParagraphID, Top
Constructor and Description |
---|
FormField()
Initializes a new instance of the
FormField class. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone() |
Object |
deepClone() |
String |
getFieldValue()
Gets or sets a string that indicates the value of the field.
|
int |
getFormFieldType()
Gets or sets a
FormFieldType enumeration that indicates the formfield type. |
int |
getTopIndex()
Gets or sets a int value that indicates the top index (in the options array) of combo or list field.
|
ValidatorCollection |
getValidators() |
void |
setFieldValue(String value) |
void |
setFormFieldType(int value) |
void |
setTopIndex(int value) |
void |
setValidators(ValidatorCollection value) |
copyTo, getBookmarked, setBookmarked
load
public boolean ComboIsEditable
Gets or sets a bool value that indicates whether the combo is editable. Default value is true.
public String[] ChoiceOptions
Gets or sets a string array that indicates the options of combo or list field.
public int[] ChoiceSelections
Gets or sets a int array that indicates the choice selection indexes.
public String FieldName
Gets or sets a string that indicates the name of the field. Note that each field MUST have a unique name.
public float FormWidth
Gets or sets a float value that indicates the width of the formfield. Default value is 100 points.
public float FormHeight
Gets or sets a float value that indicates the height of the formfield. Default value is 30 points.
public boolean CheckBoxIsChecked
Gets or sets a bool value that indicates whether the checkbox is checked. Default is false.
public String TextFontName
Gets or 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".
public com.aspose.ms.System.Drawing.Color TextColor
Gets or sets a System.Drawing.Color
object that indicates the color of the text field.
public com.aspose.ms.System.Drawing.Color BackgroundColor
Gets or sets a System.Drawing.Color
object that indicates the color of the background.
public com.aspose.ms.System.Drawing.Color BorderColor
Gets or sets a System.Drawing.Color
object that indicates the color of the border.
public com.aspose.ms.System.Drawing.Color ButtonColor
Gets or sets a System.Drawing.Color
object that indicates the color of the button.
public float TextFontSize
Gets or sets a float value that indicates the font size of the text field. Default is 14 points.
public boolean TextIsMultiLine
Gets or sets a bool value that indicate whether the text field can be multiline. Default is false.
public boolean TextIsPassword
Gets or sets a bool 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.
public int TextMaxLength
Gets or sets a int value that indicates the max length of the text can be entered in this field.
public boolean IsBordered
Gets or sets a bool value that indicates whether the text field is bordered. Default is false.
public RadioButtons RadioButtons
Gets or sets a RadioButtons
collection that indicates the radiobuttons in this field.
public int RadioButtonCheckedIndex
Gets or sets a int value that indicates the index of the radiobutton that has been checked.
public boolean IsReadOnly
Gets or sets a bool value that indicates if the field is readonly.
public boolean IsMultiSelect
Gets or sets a bool value that indicates if multi-selecting is allowed.
public Object completeClone()
completeClone
in class Paragraph
public Object deepClone()
public int getFormFieldType()
Gets or sets a FormFieldType
enumeration that indicates the formfield type.
public void setFormFieldType(int value)
public int getTopIndex()
Gets or sets a int value that indicates the top index (in the options array) of combo or list field. Default is 0.
public void setTopIndex(int value)
public String getFieldValue()
Gets or sets a string that indicates the value of the field.
public void setFieldValue(String value)
public ValidatorCollection getValidators()
public void setValidators(ValidatorCollection value)
Copyright © 2014 Aspose. All Rights Reserved.