Represents a class to edit fields, such as create fields, remove fields, move fields, change fields' attributes. Filling data into fields is implemented by another class Form.
For a list of all members of this type, see FormEditor Members.
System.Object
Aspose.Pdf.Kit.FormEditor
Thread Safety
Public static (Shared in Visual Basic) members of this type are
safe for multithreaded operations. Instance members are not guaranteed to be
thread-safe.
Example
[C#]
//Open the document and create a Form object
FormEditor formEditor = new FormEditor(@".\UnitTest\form\student.pdf", @".\UnitTest\form\added.pdf");
//add a button field
formEditor.AddField(FieldType.PushButton, "button1", 1, 50, 550, 150, 650);
//add a text field
formEditor.AddField(FieldType.Text, "text1", 1, 200, 550, 300, 575);
//set items for a ComboBox
formEditor.Items = new System.String[]{"item0", "item1", "item2", "item3"};
//add a combo box field
formEditor.AddField(FieldType.ComboBox, "combobox1", 1, 350, 650, 450, 675);
//add a check box field
formEditor.AddField(FieldType.CheckBox, "checkbox1", 1, 200, 650, 225, 675);
//set items for a list box
formEditor.Items = new System.String[]{"item0", "item1", "item2"};
//add a list field
formEditor.AddField(FieldType.ListBox, "list1", 1, 50, 710, 150, 725);
//set items for a radio group
formEditor.Items = new System.String[]{"item0", "item1", "item2"};
//add a radio button field
formEditor.AddField(FieldType.Radio, "radio1", 1, 200, 710, 225, 735);
//Close the document
formEditor.Save();
[Visual Basic]
'Open the document and create a Form object
Dim formEditor As FormEditor = New FormEditor(".\UnitTest\form\student.pdf",".\UnitTest\form\added.pdf")
'add a button field
formEditor.AddField(FieldType.PushButton, "button1", 1, 50, 550, 150, 650)
'add a text field
formEditor.AddField(FieldType.Text, "text1", 1, 200, 550, 300, 575)
'set items for a ComboBox
formEditor.Items = New System.String()
{
"item0", "item1", "item2", "item3"
}
'add a combo box field
formEditor.AddField(FieldType.ComboBox, "combobox1", 1, 350, 650, 450, 675)
'add a check box field
formEditor.AddField(FieldType.CheckBox, "checkbox1", 1, 200, 650, 225, 675)
'set items for a list box
formEditor.Items = New System.String()
{
"item0", "item1", "item2"
}
'add a list field
formEditor.AddField(FieldType.ListBox, "list1", 1, 50, 710, 150, 725)
'set items for a radio group
formEditor.Items = New System.String()
{
"item0", "item1", "item2"
}
'add a radio button field
formEditor.AddField(FieldType.Radio, "radio1", 1, 200, 710, 225, 735)
formEditor.RemoveField("watermark0")
'Close the document
formEditor.Save()
Requirements
Namespace: Aspose.Pdf.Kit
Assembly: Aspose.Pdf.Kit (in Aspose.Pdf.Kit.dll)
See Also
FormEditor Members | Aspose.Pdf.Kit Namespace