Using FormFields

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques > FormFields >

Using FormFields

Previous pageReturn to chapter overviewNext page

The following code

VPE.OpenDoc

VPE.CharCount = 15

VPE.FormField(1, 1, -10, VFREE, "Hello World!")

VPE.Preview

will produce

ProgrammersManual_img46

As you can see, the font size is computed by VPE automatically in a way that the characters will fit best into the given width.

The FormField is surrounded by a rectangle, because after calling OpenDoc() VPE sets the PenSize by default to 0.3 mm.

In order to remove the surrounding rectangle, use the following code:

VPE.OpenDoc

VPE.PenSize = 0

VPE.CharCount = 15

VPE.FormField(1, 1, -10, VFREE, "Hello World!")

VPE.Preview

ProgrammersManual_img47

 

The following code will set the pen size of the dividers to 0.06 (0.6mm, the default is 0.1mm) and reduce the height of the dividers to ¼ (which is by default at ½):

VPE.OpenDoc

VPE.CharCount = 15

VPE.DividerPenSize = 0.06

VPE.DividerStyle = VFF_STYLE_1_4

VPE.FormField(1, 1, -10, VFREE, "Hello World!")

VPE.Preview

formfield 0003

Please note that the font size (and therefore also the automatically computed height of the FormField!) had changed a bit, because due to the thicker dividers there is less space for the characters.

Possible styles are:

Style

Value

Comment

VFF_STYLE_NONE

0

no dividers

VFF_STYLE_1_4

1

1/4 height

VFF_STYLE_1_3

2

1/3 height

VFF_STYLE_1_2

3

1/2 height (default)

VFF_STYLE_2_3

4

2/3 height

VFF_STYLE_3_4

5

3/4 height

VFF_STYLE_1_1

6

full height (default for AltDivider)

 

Take a look at the following code sample:

VPE.OpenDoc

VPE.CharCount = 15

VPE.DividerStyle = VFF_STYLE_1_1

VPE.FormField(1, 1, -10, VFREE, "Hello World!")

VPE.Preview

ProgrammersManual_img48