37
CITIZEN UWP POS Print SDK - Programming Manual
2.3.8. PrintTextAsync method
Syntax
Task<int> PrintTextAsync (string data, int alignment, int attribute, int textSize)
Parameter
The meaning and the setting range of the parameters are as follows.
Value
[IN/OUT]
Meaning
Setting range
data
[IN]
Text data
alignment
[IN]
Text alignment
CMP_ALIGNMENT_LEFT: Left alignment
CMP_ALIGNMENT_CENTER: Center alignment
CMP_ALIGNMENT_RIGHT: Right alignment
attribute
[IN]
Text attribute
CMP_FNT_DEFAULT: Default font
CMP_FNT_FONTB: Font B
CMP_FNT_FONTC: Font C
CMP_FNT_BOLD: Bold
CMP_FNT_REVERSE: Reverse
CMP_FNT_UNDERLINE: Underline
textSize
[IN]
Text size
CMP_TXT_1WIDTH: 1 times width
CMP_TXT_2WIDTH: 2 times width
CMP_TXT_3WIDTH: 3 times width
CMP_TXT_4WIDTH: 4 times width
CMP_TXT_5WIDTH: 5 times width
CMP_TXT_6WIDTH: 6 times width
CMP_TXT_7WIDTH: 7 times width
CMP_TXT_8WIDTH: 8 times width
CMP_TXT_1HEIGHT: 1 times height
CMP_TXT_2HEIGHT: 2 times height
CMP_TXT_3HEIGHT: 3 times height
CMP_TXT_4HEIGHT: 4 times height
CMP_TXT_5HEIGHT: 5 times height
CMP_TXT_6HEIGHT: 6 times height
CMP_TXT_7HEIGHT: 7 times height
CMP_TXT_8HEIGHT: 8 times height
Description
This method is used to print text which specifies alignment and attribute and size.
Text attribute can be specified in combination font B, font C, bold, reverse, and underline. If you want to
combine, please specify the logical sum.
Text size can be specified in combination with the width and height. If you want to combine, please
specify the logical sum.
Return value
Return CMP_SUCCESS (0) in success. Please refer to "
" for the error code except it.
Example
await printer.PrintTextAsync( "Print text data.\n",
ESCPOSConst.CMP_ALIGNMENT_CENTER,
ESCPOSConst.CMP_FNT_BOLD | ESCPOSConst.CMP_FNT_UNDERLINE,
ESCPOSConst.CMP_TXT_2WIDTH | ESCPOSConst.CMP_TXT_2HEIGHT );