RpPrinter:DrawText() Method
<< Click to Display Table of Contents >> RpPrinter:DrawText() Method |
![]() ![]() ![]() |
Purpose
To draw text on the printer or print preview window. DrawText supports multi-line text and automatically clips text that does not fit within it's drawing rectangle.
Syntax
<oRpPrinter>:DrawText([nY], [nX], cText, [nHeight], [nWidth],
[nAlignment], [oTextColor], [oBkGndColor], [lNoClip])
Arguments
nY |
Optional. The top row of the text cell. The default is the current PROW setting. |
nX |
Optional. The left column of the text cell. The default is the current PCOL setting. |
cText |
The text to draw. |
nHeight |
Optional. The height of the text cell. The default is the AvgCharHeight setting. |
nWidth |
Optional. The width of the text cell. The default is the AvgCharWidth setting times the length of cText. |
nAlignment |
Optional. The alignment of the text within the text cell. Valid settings are ALIGN_RIGHT, ALIGN_CENTER, ALIGN_LEFT, or ALIGN_FULL The default is ALIGN_LEFT. |
oTextColor |
Optional. Color object for setting the text color. The default is Color{COLORBLACK}. |
oBkGndColor |
Optional. Color object for setting the background color. The default is Color{COLORWHITE}. |
lNoClip |
Optional. If TRUE prevents DrawText from clipping the text that doesn't fit in the drawing rectangle. The default is FALSE |
Description
This method draws text on the printer or print preview window. Unless lNoClip is TRUE, a clipping rectangle is created using the parameters passed to this method. DrawText() clips the text so it will not be drawn outside the clipping region. In most cases you should use RpPrinter:TextOut() instead of DrawText. TextOut is slightly faster.
Example
// Draw some text
oRpPrinter:DrawText(, , "Hello World!")