InformationsAuthor:Denis Van Nuffelen
Caution: the generated PDF works only with Acrobat Reader 5.1.
Upon field creation, an associative array can be passed to set a number of properties, among which:
TextColor (black by default)
FillColor (transparent by default)
BorderColor (transparent by default)
BorderStyle (solid, dashed, beveled, inset or underline; solid by default)
Colors can be chosen in the following list (case sensitive):
black white red green blue cyan magenta yellow dkGray gray ltGray
or be in the form #RRGGBB.
Methods to create fields are the following:
TextField(string name, float w, float h [, array prop])
name: field name.
prop: properties. The value property allows to set the initial value. The multiline property allows to define the field as multiline.
ComboBox(string name, float w, float h, array values [, array prop])
name: combobox name.
values: array containing the list of values.
CheckBox(string name, float w [, boolean checked [, array prop]])
name: checkbox name.
checked: boolean defining the initial state (false by default).
Button(string name, float w, float h, string caption, string action [, array prop])
name: button name.
ExampleHere is an example which creates a form with the different possible field types. When one clicks on the button, the mandatory fields are checked, and, if validation passes, the page is printed.
View the result here.