Page print commands – draw commands – Datamax-O'Neil APEX Series Programmer’s Manual User Manual
Page 43

37
Mark Beginning of a Page
BeginPage();
This command follows Esc P P command and is used to indicate the beginning of a form in page printing mode.
Define the Page Size
SetPageSize (width, height);
This command is used to define the valid drawing area for a label or form. Two parameters are required: width and height of the
form, measured in dots.
Set Margins
SetMargin (lm, tm);
This command sets the left margin to lm and the top margin to tm. The margin is then used as a start point (0, 0) for the form or
label.
Mark Page End, Print and Exit
EndPage();
This command is used to end a form or label while in the Page Printing mode. This command also forces the printer to print a
label or form.
Page Print Commands – Draw Commands
Draw Text
DrawText (x,y,color,angle,"string");
Draws text at any coordinate on the canvas.
DrawText “data” prints the text enclosed in the double quotes at the current cursor location. x and y specify where the text is to
be printed (upper left corner of the first letter of the top line).
Parameters:
x
specifies “x” axis location
y
specifies “y” axis location
Color
specifies text color: 0 = white, 1= black.
User may print white text on an existing black background by specifying color = 0.
Angle
specifies text direction
Angle Print
angle
Description
0
0 degrees Counter-clockwise
Prints text horizontally from left to right.
1
90 degrees Counter-clockwise
Prints text vertically in the upward direction
2
180 degrees Counter-clockwise
Prints text horizontally from right to left
3
270 degrees Counter-clockwise
Prints text vertically in the downward direction.
String
specifies the text to print
Multiple lines can be printed with a single ‘DrawText’ command by separating the lines with \n characters. Text formatting is
accomplished by tags inserted in the string argument. The formatting is effective only in the string in which it appears and does
not carry over to the subsequent DrawText commands. The text formatting commands are listed below.