You can't just send ASCII text once the printer is in PCL XL mode.
Here is a snippet from an analysis of a PCL XL print stream, showing just a couple of
Operators and their (preceding)
Attribute lists, which may make things a bit clearer:
Code:
Offset(dec) Type Sequence Data / Interpretation
¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
0000036381 PCLXL Data Type 0xd3 sint16_xy
0000036382 Value 0xc0030309 960 2307
0000036386 PCLXL Attribute 0xf84c Point
0000036388 PCLXL Operator 0x6b SetCursor
0000036389 PCLXL Data Type 0xc8c11000 ubyte_array
0000036393 Value 0x404142.. "@ABCDEFGHIJKLMNO"
0000036409 PCLXL Attribute 0xf8ab TextData
0000036411 PCLXL Data Type 0xc8c11000 ubyte_array
0000036415 Value 0xc8c8c8.. ( 200 200 200 200 200 200 200 200 200 200
0000036425 0xc8c8c8.. 200 200 200 200 200 200 )
0000036431 PCLXL Attribute 0xf8af XSpacingData
0000036433 PCLXL Operator 0xa8 Text
Note that (for brevity) this snippet is quite a way down the stream (as indicated by the Offset values), so it doesn't show the stream header, any BeginPage or EndPage operators, or any font 'selects', etc.
The
Sequence column shows the actual contents if the print stream (in hexadecimal notation).
Note that 0x4c (i.e. hexadecimal
4C) may be an Attribute identifier (
Point in this example), or could be the text character
L, depending on context.
Similarly, 0x6b (i.e. hexadecimal
6B) may be an Operator identifier (
SetCursor in this example), or could be the text character
k, again depending on context.
Note also that the
XSpacingData attribute of the
Text operator must be present in order to specify cursor movement between the text characters, so you need to know the 'Advance Width' of each of your characters in the chosen font, at the chosen point size.
If you don't specify this, all characters will be (over-)printed at the same position.
The
XSpacingData values in the snippet are all 200 (earlier Operators (not shown) specified that the chosen units are 600 per inch).
As the values are all the same, this implies that the selected font is almost certainly a fixed-pitch one.