An interactive form—sometimes referred to as an AcroForm—is a collection of fields for gathering information interactively from the user. A PDF document may contain any number of fields, appearing on any combination of pages, all of which make up a single, global interactive form spanning the entire document.
Field Types
Interactive forms support the following field types:
- Button fields represents, interactive controls on the screen, a user can manipulate with the mouse. They include push buttons, check boxes, and radio buttons.
- Text fields are boxes or spaces in which the user can enter text from the keyboard.
- Choice fields contain several text items; only one value may be selected at a time.They include scrollable list boxes and combo boxes.
Button Form Field
This example shows how to create a Button and add it to the page.
[ASP - VBScript]
Dim MyButton
Set MyButton = MyPage.AddButton( "Button Name", 50, 50, 100, 50 )
MyButton.SetJavaScriptAction "app.alert('Hello');"
MyButton.BackgroundColor = "AliceBlue"
MyButton.Behavior = DPDF_Behavior_Push
MyButton.BorderColor = "BlueViolet"
MyButton.BorderStyle = DPDF_BorderStyle_Beveled
MyButton.Label = "Push"
MyButton.TextColor = DarkGreen
MyButton.ToolTip = "Click"
Check Box Form Field
This example shows how to create an Check Box and add it to the page.
[ASP - VBScript]
Dim MyCheckBox
Set MyCheckBox = MyPage.AddCheckBox( "Check Box Name", 5, 7, 50, 50 )
MyCheckBox.Symbol = DPDF_Symbol_Check
MyCheckBox.ToolTip = "Check it"
Combo Box Form Field
This example shows how to create a Combo Box and add it to the page.
[ASP - VBScript]
Dim MyComboBox
Set MyComboBox = MyPage.AddComboBox( "Combo Box Name", 50, 75, 150, 25 )
MyComboBox.AddItem("One")
MyComboBox.AddItem("Two")
MyComboBox.AddItem("Three")
MyComboBox.BackgroundColor = "AliceBlue"
MyComboBox.BorderColor = "DarkMagenta"
MyComboBox.DefaultChoice = "One"
MyComboBox.Editable = true
MyComboBox.ToolTip = "Select"
List Box Form Field
This example shows how to create a List Box and add it to the page.
[ASP - VBScript]
Dim MyListBox
Set MyListBox = MyPage.AddListBox( "List Box Name", 5, 2, 100, 150 )
MyListBox.AddItem("One")
MyListBox.AddItem("Two")
MyListBox.AddItem("Three")
MyListBox.BackgroundColor = "AliceBlue"
MyListBox.BorderColor = "DarkMagenta"
MyListBox.BorderStyle = DPDF_BorderStyle_Dashed
MyListBox.DefaultChoice = "One"
MyListBox.Multiselect = true
MyListBox.ToolTip = "Select"
Radio Button Form Field
This example shows how to create a Radio Button and add it to the page.
[ASP - VBScript]
Dim MyRadio1
Set MyRadio1 = MyPage.AddRadioButton( "Radio Button Name", 50, 25, 100, 75 )
MyRadio1.DefaultChecked = true
MyRadio1.ExportValue = "abc"
MyRadio1.ToolTip = "First"
Dim MyRadio2
Set MyRadio2 = MyPage.AddRadioButton( "Radio Button Name", 50, 140, 100, 75 )
MyRadio2.ExportValue = "def"
MyRadio2.ToolTip = "Second"
Dim MyRadio3
Set MyRadio3 = MyPage.AddRadioButton( "Radio Button Name", 50, 250, 100, 75 )
MyRadio3.ExportValue = "ghi"
MyRadio3.ToolTip = "Third"
Text Form Field
This example shows how to create a Text Field and add it to the page.
[ASP - VBScript]
Dim MyTextField
Set MyTextField = MyPage.AddTextField ("Text Field Name", 50, 75, 150, 100)
MyTextField.TextAlign = DPDF_Align_Center
MyTextField.BackgroundColor = "AliceBlue"
MyTextField.BorderColor = "DeepPink"
MyTextField.TextColor = "Brown"
MyTextField2.DefaultValue = "ceTe Software"
MyTextField2.MultiLine = true
MyTextField2.ToolTip = "Text"
| See Also |
Button Object | CheckBox Object | ComboBox Object | ListBox Object | RadioButton Object | TextField Object | Programming with Generator for COM-ActiveX

