DynaPDF Manual - Page 315

Previous Page 314   Index   Next Page 316

Function Reference
Page 315 of 839
CreateTextField
Syntax:
SI32 pdfCreateTextField(
const PPDF* IPDF, // Instance pointer
const char* Name, // Name of the text field
SI32 Parent,
// Parent group field if any or -1
LBOOL Multiline,
// Enable multi line text output
SI32 MaxLen,
// Maximum length of the text or 0
double PosX,
// X-Coordinate of the text field
double PosY,
// Y-Coordinate of the text field
double Width,
// Width of the text field
double Height)
// Height of the text field
This function creates a text field. A text field is a box or space in which the user can enter text from
the keyboard. The text is may be restricted to a single line or may be allowed to span multiple lines,
depending whether the parameter Multiline is true or false. The parameter MaxLen specifies if the
length of the text should be restricted; if zero, the length is not restricted.
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the text
field. If the coordinate system is top-down it defines the upper left corner.
Like all form fields, the width and height is measured incl. the line width of the border. The size of
normal vector graphics is measured without the line width; this must be taken into account when
calculating the width or height of a form field.
The line width of the border is taken from the current graphics state (see SetLineWidth()), it should
be either 0, 1, 2, or 3 units (no border, thin, medium, or thick). The border style can be changed with
the functions SetBorderStyle() or SetFieldBorderStyle().
A text field requires a font. If no font is active the standard font Helvetica is used. Note that when
the form must be compatible to Acrobat 4, the used fonts by the form fields must be restricted to the
14 standard fonts (see SetFont() for further information). Acrobat 4 does not support interactive
forms that use other fonts; such a form requires Acrobat 5 or higher.
Form fields support natively the code pages 1252 and MacRoman. However, other code pages and
Unicode can be used too as long as a few external cmaps are available. See SetFieldFont() for further
information.
The alignment of the text can be changed with the function SetFieldTextAlign().
The font size of a text field is set to "auto" if the flag ffMultiline is not set and if either the font size of
the active font is set to 1.0 unit or if no font is active when the field is created.
A text field can be formatted and the allowed input values can be restricted to specific data formats.
See SetDateTimeFormat(), SetNumberFormat() for further information.
 

Previous topic: The standard date format

Next topic: Specific flags supported by text fields: