User’s manual for thermal printer
CONTENTS
SECTION I           ACCOUNT OF TYPE AND PARAMETER OF CAPABILITY ...... - 1 -
SECTION II          ASSEMBLY AND APPLICATION OF INTERFACE ....................... - 2 -
SECTION III         PRINT COMMANDS........................................................................... - 5 -
SECTION Ⅳ           CHARACTER SETⅠ、Ⅱ ................................................................ - 16 -
SECTION Ⅳ           COMMAND TABLE FOR QUICK CONSULTANT....................... - 17 -
SECTION I                        Account of Type and Parameter of
                                     Capability
Printing method:                   Thermal line dot printing
Paper width:                       80±0.5mm
Printing density:                  8dot/mm, 576dot/line
Printing speed:                    27mm/ 8s (when the utilization rate is 50.)
life-span of print head :          6×106 character line
Printing width:                    72mm
Temperature for operating:         5~50℃
Humidity for operating:            10~80%
Temperature for storage:           -20~60℃
Humidity for storage:              10~90%
Power:                             There are three kinds of printer refer to the type of printer
                                   (Page 4)
INTERFACE:                         IDE20: Parallel port: TTL and Serial port: TTL
                                   IDE20: Serial port: 232
CHARACTER:                         Character setⅠ、Ⅱ20H-A0H
                                   DBC case character set 20H-7FH
                                   GB Chinese character
                                   16*16 dots matrix Chinese character enlarge 2 times by default
http://www.whkj.com.cn                                                                                    -1-
                                                                                 User’s manual for thermal printer
                                       24*24 dots matrix Chinese character enlarge 1 times by default
          SECTION II                       Assembly and application of
                                             Interface
2-1 The definition of interface
               BU SY
               /A CK
               DA TA
               /S TB                                            0. 5μS
                                                                0. 5μS
                                           0. 5μS
                                          0. 5μS
                                         0. 5μS
2-1-2 The definition of parallel interface
                       1                               19
                       2                                 20
The pin definition of parallel interface is shown as follow:
    pin       signal direction                                           description
     1         -STB        In    Data selecting burst purse . reading occurs at the rising edge.
     3        DATA1        in
     5        DATA2        in
     7        DATA3        in
     9        DATA4        in    These signals represent the 1~8 bit of the parallel data. Each signal is high level when
                                 logic 1 and low level when logic 0.
     11       DATA5        in
     13       DATA6        in
     15       DATA7        in
     17       DATA8        in
                                 Answering pulse ,low signal indicates that data have already been received and is ready
     20        -ACK        out
                                 for next data.
     18       BUSY         out   High level indicates that the printer is busy now and can not receive more data.
     19         PE         out   High level indicates lacking paper
     4         SEL         out   Pulling up to high level signal by resister inside, it indicates that the printer is online
      14       Port&p      in    When use parallel interface, connect to GND.
2,6,8,10,12,16 GND         —     grounding signal
Attention: (1)“in” indicates input to the printer, ”out” means output from the printer
              (2)signal level is TTL standard
2-1-3 The definition of the serial interface
                  1                                  19
                 2                                  20
http://www.whkj.com.cn                                                                                               -2-
                                                                                 User’s manual for thermal printer
1. TTL:
The pin definition of serial interface is shown as follow:
   pin        signal     direction                                 description
    20         RXD          in       receiving data from the CPU
    19         TXD         out       transmit status messages out of printer
                                     high level indicates the printer is busy and can’t receive data now . Low
    18        BUSY         out
                                     level is the opposite.
2,6,8,12,16   GND           —        grounding signal
Attention: (1)“in” indicates input to the printer,”out” means output from the printer
            (2)signal level is EIA standard or TTL standard.
2. RS-232C:
The pin definition of serial interface is shown as follow:
   pin        signal     direction                                 description
    19         RXD          in       receiving data from the CPU
    20         TXD         out       transmit status messages out of printer
                                     high level indicates the printer is busy and can’t receive data now . Low
    18        BUSY         out
                                     level is the opposite.
2,6,8,12,16   GND           —        grounding signal
Attention: (1)“in” indicates input to the printer,”out” means output from the printer
            (2)signal level is EIA standard or TTL standard.
2-2 operation notice
There are one light and two keys, LF key and SET key. The LF key is in the top left corner of the
front. It is also a light. The SET key is in a hole top left corner of the back. After powered on, when
press the LF key, The printer will feed paper. And the SET key is not used.
After powerd on, the light will bright all the time. When paper is lacking,the light flash.
●The ways to change the serial printer’s baud rate and communication mode:
Press SET Key and make printer power on at the same time . The printer will print out the state of
serial setting. And press the SET key again.The printer will print out another state of serial
setting .And then press the LF key again .After that we can chang the serial baud rate through the
LF key and the communication mode though the SET key.
Baud rate in serial mode is optional in the range of 1200\2400\4800\9600\19200bps.The original
setting is 9600bps and can be alternated by the LF key.
The printer has to be repowered after setting.
The original communication mode setting is mode 1,and can be alternated by the SET key.
Asynchronous frame format is shown as following:
     1 bit              8 bit          1 bit              1 bit
   start bit           data bit        none             stop bit
   start bit           data bit        parity           stop bit
mode1: one frame is 10 bits, 1 start bit, 8 data bits and 1 stop bit.
Mode3: one frame is 11 bits, 1 start bit, 8 data bits, 1party bit and 1 stop bit.
http://www.whkj.com.cn                                                                                           -3-
                                                                   User’s manual for thermal printer
●The ways to change the printer’s chroma:
Press SET Key and make printer power on at the same time .It will print out the state of printer.
After that we can chang the chroma through the LF keys. And then press the SET Key to
decrease chroma and the LF Key to augment chroma.
The printer has to be repowered after setting.
●The ways to change the serial printer orientation:
Press SET Key and make printer power on at the same time . The printer will print out the state of
setting. then press the SET key again , The printer will print out another state of setting .After that
we can chang the print orientation through the SET key . And then please press SET key to set
negative direction,and press LF key to set forward direction. The original setting is forward
direction.
●The way to self-check:
.Press the LF Key and repower at the same time, and then the printer will print out the self-check
scrip.
2-3 power supply connection
There are three kinds of power supply mode of printer, please refer to the type of the printer. and it
is shown as follows:
                            1   2   3
ⅰ:The power supply is DC 5V, 2A, max. 1A, average.
  Pin Definition: 1: DC 5V positive pole;2: NC;3: GND.
ⅱ:Printer head and control panel are powered respectively. The power supply of printer head: is
  DC 5V-7.5V (7.5V best), 2.5A max. 1.5A average. The power supply of control panel is DC
  5V, 70mA.
  Pin Definition: 1: control panel DC 5V positive pole;2: printer head DC 5V-7.5V positive pole;
  3: GND
ⅲ:Printer head and control panel are powered respectively. The power supply of printer head: is
  DC 5V-7.5V (7.5V best), 2.5A max. 1.5A average. The power supply of control panel is DC
  3.3V, 70mA.
  Pin Definition: 1: control panel DC 3.3V positive pole;2: printer head DC 5V-7.5V positive
  pole;3: GND
http://www.whkj.com.cn                                                                         -4-
                                                                 User’s manual for thermal printer
                 SECTION III                    Print Commands
Part 1    Character Set and Paper Feeding Commands
3-1-1 select character font 1
  Format:       ASCII:      ESC     6   n
                 Dec:       27     54 n
                  Hex: 1B         36    n
  Explanation:
    When n=0, it will print out according the character setⅠ, rang from 20H to A0H.
    When n=1, it will print out according the character setⅡ, rang from 20H to A0H.
    When n=2, it will print out according the DBC case character set, rang from 20H to 7FH.
    When n=3, it will print out according the user-defined character set, rang from 20H to 7FH.
    Default n=2.
3-1-2 Paper Feed in Line
Format:         ASCII: LF
                  Dec:     10
                  Hex:     0A
Explanation:
Content in the buffer will be carried out after this command. The paper feeds in for a new line. The
length is the high of one character and the distance rows between.
3-1-3     n Dot Line Feed
Format:       ASCII: ESC         J      n
               Dec:    27       74     n
               Hex:    1B       4A      n
Explanation:
  The printer feeds paper n dot lines. N=0~255. This command sends carriage return and feed line.
It won’t influence the latter feed line command.
Part 2    Format Setting Commands
3-2-1    Set n Dot-line Spacing
Format: ASCII:     ESC      1    n
           Dec:    27       49    n
           Hex:    1B       31    n
Explanation:
The space between lines are n dots after this command (The dot number is unconditional and
can’t be affected by enlarging command.) 1≤n≤255. The original setting: n=3.
3-2-2 set the space between characters
Format: ASCII:    ESC     P    n
           Dec:   27    112     n
http://www.whkj.com.cn                                                                      -5-
                                                                   User’s manual for thermal printer
             Hex:    1B      70    n
This command sets the space between characters n dots (The dot number is unconditional and
can’t be affected by enlarging command.) 1≤n≤255. The original setting: n=0.
3-2-3 Set Vertical Tab Value
Format: ASC: ESC B n1 n2 n3…..NUL
            Dec:    27     66 n1 n2 n3…..0
            Hex:    1B     42 n1 n2 n3….00
Explanation:
The vertical tab positions are entered as n1, n2 and so on, The total number of position is 8, all of
these should be within the page length set by ESC C command.
For example, when n1 = 3, paper will feed in to the 3rd. unit line after “VT” command. The height of
unit line is the sun of 8 dots and characters between, and is unconditional. Command NUL added
at the end indicates the command is over.
All vertical tab positions that input can be deleted by using this command in ESC B NUL format.
VT command is to carry out vertical tab , the paper fed to the next vertical position.
3-2-4 Carry out Vertical Tab Value
Format:        ASCⅡ:          VT
                  Dec:        11
                  Hex:        0B
Explanation:
Feed paper to the next vertical tab position which is set by ESC B command.
Notice: if there is no vertical tab value setting, or the current position equals or is beyond the last
vertical tab position, VT command is to feed paper one line only(same to LF command).
3-2-5   Set Horizontal Tab Value
Format: ASCⅡ: ESC D n1 n2 n3….NUL
            Dec: 27       68 n1 n2 n3….0
            Hex: 1B       44 n1 n2 n3….00
Explanation:
The tab positions are entered as n1,n2 and so on, the total number of position is 8, and all of these
should be within the line width of this model printer.
For example, when n1 = 3, paper will feed in to the 3rd. unit line after “HT” command. The width of
each step is the sum of width of character matrix and dots characters between horizontal.
Command NUL added at the end indicates the command is over.
All horizontal tab positions that set can be deleted by using this command in ESC D NUL format.
3-2-6   Carry out Horizontal Tab Value
Format:     ASCⅡ:      HT
              Dec:     9
              Hex:     09
Explanation:
http://www.whkj.com.cn                                                                         -6-
                                                                     User’s manual for thermal printer
The print position is advanced to the next horizontal tab position which is set by ESC D command.
If there is no horizontal tab value setting, or the current position equals or is beyond the last
horizontal tab position, HT command won’t be carried out.
3-2-7     Print Blank Character or Lines
Format:       ASCⅡ:        ESC      f     m    n
               Dec:        27    102 m        n
               Hex:        1B    66      m    n
Explanation:
When m = 0, ESC f NUL n will command to print n blank characters, the value of n should be
within the line width of this model printer. When m = 1, ESC f SOH n will command to print n blank
lines. n=0~255.
3-2-8   Set Right Margin
Format: ASCⅡ: ESC Q                 n
           Dec: 27 81              n
              Hex:    1B     51    n
Explanation:
N value means n-characters blank space on the right side will be left. Each character space is the
sum of width of the character matrix and the horizontal space between. The value of n should be
in the range from 0 to the line width of this model printer.
Default n = 0, that means no right margin.
3-2-9    Set Left Margin
Format: ASCⅡ:         ESC 1        n
              Dec:    27   108     n
              Hex:    1B 6C        n
Explanation:
N value means n-characters blank apace on the left side will be left. Each character space is the
sum of width of the character matrix and the horizontal space between. The command is relative
to the enlarging command.
Default n = 0, that means no left margin.
3-2-10 set the gray degree
Format: ASCII:       ESC      M       n
            Dec:      27    109       n
            Hex:      1B     6D      n
N ranges from 1 to 6 ,the larger of the n value is, the darker the dot it is . The initial n=0. It is used
to modify the final expression of different thermal paper roll.
Part 3 Character Setting Commands
3-3-1  Enlarge Width
Format: ASCⅡ:       ESC            7     n
http://www.whkj.com.cn                                                                           -7-
                                                               User’s manual for thermal printer
             Dec:        27    55     n
             Hex:        1B    37     n
Explanation:
After the commend ,The character would be enlarged in width .
When n=0, 1 times .
         n=1, 1.5 times
         n=2, 2 times
         n=3, 3 times
         n=4, 4 times
24*24 dots matrix printer default n=0,that means normal width, no width enlarging.
16*16 dots matrix printer default n=2,enlarge 2 times in width.
3-3-2 Enlarge Height
Format: ASCⅡ:           ESC       8     n
             Dec:      27      56      n
             Hex:      1B       38      n
Explanation:
After the commend ,The character would be enlarged n times in height. n= 1~4,
24*24 dots matrix printer default n=0, that means normal height, no height enlarging.
16*16 dots matrix printer default n=2, enlarge 2 times in height.
3-3-3 Select/cancel Chinese Character DBC case 16*16 dots matrix
Format: ASCⅡ:          ESC       :  n
               Dec:   27       58    n
               Hex:   1B       3A    n
Explanation:
After this commend ,it will make sure the Chinese character set ,rang from A1H to A9H,if it is
printed out in DBC case ,or not.
when n=0, cancel DBC case print ,the character would be printed out as large as Chinese
character in width;
when n=1, select DBC case print, the width of the character printed out is half of the Chinese
character in width.
Default n-=1.
3-3-4    Select/cancel Underline Print
Format: ASCⅡ:          ESC -     n
             Dec:     27 45 n
             Hex:     1B 2D n
Explanation:
When n=1, select underline print; when n=0, cancel underline print.
All characters including spaces will be printed out with underline after selecting underline print
command. Default n=0.
3-3-5 Select/cancel Up-line Print
Format: ASCⅡ:         ESC +       n
             Dec:     27 43 n
             Hex:     1B 2B n
Explanation:
When n=1, select up-line print ; when n=0, cancel up-line after selecting up-line print command,
http://www.whkj.com.cn                                                                    -8-
                                                                   User’s manual for thermal printer
unless cancel the up-line print command. Default n=0.
3-3-6     Select/cancel Reverse White Print
Format: ASCⅡ:              ESC      i    n
               Dec:       27     105     n
               Hex:       1B      69     n
Explanation:
When n=1, select reverse white print; when n=0, cancel reverse white print. Reverse white print is
printing in the black background, just like the film of photography.
It is normal print that printing black characters in white background, it is selected at power on or on
ESC @ command.
3-3-7 Select/cancel Reverse Print
Format: ASCⅡ:         ESC      c      n
                Dec:  27     99       n
                Hex:  1B     63       n
Explanation:
When n=0, select reverse print, printing from right to left. When n=1, cancel reverse print, printing
from left to right.
When the printer is assembled vertically, it is convenient to read the word reversely so its initial
value is 1.
3-3-8 Set Character Rotational Print
Format: ASCⅡ:         FS         I        n
            Dec:      28        73        n
            Hex:      1c        49       n
This command is to rotate characters, which is 6*8 dots matrix. The values of n are as following:
n Characters rotated widdershins
0                 0º
1                 90º
2                180º
4                270º
3-3-9 Select Superscript and Subscript Print
Format:     ASCⅡ:       FS      r       n
              Dec:     28      114      n
              Hex:     1c       72       n
This command is to select the position for superscript and subscript, n=0 is superscript and n= 1 is
subscript. When the character is less then the highest one in the same line ,the character is align
top or bottom with the highest one.
Part 4 User-defined Character Setting Commands
http://www.whkj.com.cn                                                                         -9-
                                                                  User’s manual for thermal printer
3-4-1 User-defined Characters
Format: ASCⅡ:      ESC & s n m a1 p1[s*a ] a2 p2[s*a]
           Dec:    27 38 s n m a1 p1[s*a ] a2 p2[s*a]
           Hex:    1B 26 s n m a1 p1[s*a ] a2 p2[s*a]
Explanation:
This command allows a character to be defined.
When 24*24 dots matrix:     s=3           33≤n≤m≤127
0≤a≤12          0≤p≤36
When 16*16 dots matrix:     s=2           33≤n≤m≤127
0≤a≤8          0≤p≤16
Parameter s express the number of longitudinal bytes.
Parameter m and n is the code of user-defined character. Parameter n express the start structure
codes of user-define. Parameter m express the stop structure codes of user-defined. The number
of code is m-n+1. When define only one , n=m. The max number of user-defined character is 95
Parameter a express the dot number horizontally.
Parameter p express the dots matrix data of dot number , p=s*a.
24*24 Data format [s*a ]:
               d1   d4
               d2   d5
               d3   d6
16*16 Data format [s*a ]:
               d1 d3
               d2 d4
Notice: the data is from the top down, and then from left to right.
For example:
    16X16 dots matrix, 8X16 character
1       8
D7□□□□□□□□
  □□□□□□□□
  ■■■■■■■■
  ■■■■■■■■
  □□□■■□□□
  □□□■■□□□
  □□□■■□□□
D0□□□■■□□□
D7□□□■■□□□
  □□□■■□□□
  □□□■■□□□
  □□□■■□□□
  □■□■■□□□
  □□■■■□□□
  □□□□□□□□
D0□□□□□□□□
 d1=30h,d2=00h,d3=30h,d4=08h,d5=30h,d6=04h,
http://www.whkj.com.cn                                                                       - 10 -
                                                                  User’s manual for thermal printer
d7=3fh,d8=0fch,d9=3fh,d10=0fch,d11=30h,d12=00h,d13=30h,d14=00h,d15=30h,d16=00h
   24X24 dots matrix, 12X24 character
1           12
D7□□□□□□□□□□□□
  □□□□□□□□□□□□
  □□□□□□□□□□□□
  ■■■■■■■■■■■■
  ■■■■■■■■■■■■
  □□□□□■■□□□□□
  □□□□□■■□□□□□
D0□□□□□■■□□□□□
D7□□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
D0□□□□□■■□□□□□
D7□□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□□□■■□□□□□
  □□□■□■■□□□□□
  □□□□■■■□□□□□
  □□□□□□□□□□□□
  □□□□□□□□□□□□
D0□□□□□□□□□□□□
d1=18h,d2=00h,d3=00h,d4=18h,d5=00h,d6=00h
d7=18h,d8=00h,d9=00h,d10=18h,d11=00h,d12=10h
d13=18h,d14=00h,d15=08h,d16=1fh,d17=0ffh
d18=0f8h,d19=1fh,d20=0ffh,d21=0f8h,d22=18h
d23=00h,d24=00h,d25=18h,d26=00h,d27=00h
d28=18h,d29=00h,d30=00h,d31=18h,d32=00h,
d33=00h,d34=18h,d35=00h,d36=00h
Part 5    Print Graphics
3-5-1     Print bit-map graphics
Format: ASCⅡ: ESC K              n1 n2…data…
               Dec: 27 75 n1 n2…data…
               Hex: 1B 4B        n1 n2…data…
Explanation:
mi mh stand for a 16 bits binary datum . ml is the low 8 bits and mh is the high 8 bits. The number
of graph data is mh×256+ml. The size of graph depends on the enlarging command.
The command will print a iX8 dots graph unit for the 16X16 dots type printer. Its width is i dots and
height is 8 dots. A 8-bit binary datum express row structure and the high bit is on the top.
The command will print a(i/3)×24 dots graph unit for the 24X24 dots type printer. Its width is i/3
dots and height is 24 dots. A 8-bit binary datum express a 8-dot row structure, so three 8-bit binary
data is need to express the whole row, the 24-dot row. The high bit is on the top. The order of the
data is first from the top to the bottom and then from left to right.
If your graph is large than one graph unit . you can divide the graph to different unit ,set and print
them separately. For example more than 8-dot height for a 16X16 dots type printer, you can divide
the graph to different 8-dot unit and print them respectively.
http://www.whkj.com.cn                                                                        - 11 -
                                                                     User’s manual for thermal printer
             1 2 3 4 5 6 7 8 9 101112
        D7   □□□■□□□□□■□□
             □■■■■■□■■■■■
             □■□□□□□□□■□□
             □■□□□□□□□■□□
             □■□□□□□□■□■□
             ■□□□□□□■□□□■
             □□□□□□□□□□□□
        D0   □□□□□□□□□□□□
3-5-2 dot line print
Format: ASCII: ESC V n1 n2 data.1~data.n2
            Dec: 27         86   n1 n2 data.1~data.n2
            Hex: 1b         56   n1 n2 data.1~data.n2
Explanation:
n1: the two lower bit is effect.
when n1.0=1,print graph twice in height
      n1.0=0,print graph in original height
      n1.1=1,print graph twice in width
      n1.1=0,print graph in original width
n2: the large number of the byte of one line. the max is 72 (one line is 576 in dot, one byte is 8 dot
8*72),when print twice in width is 36.
Data.1~data.n2:n2 graph data
The command is used to print one line graph data
【curve print】
Explanation: The two groups of commands below is to print curve. Use the group of commands , it
will print out abscissa ,coordinate and scale .The origin printed out by the first group is in the left of
the paper, the other is in the right.
3-5-3、【format 1 print y-axis and curve in the direction of cutting paper】
Format: ASCII: FS               L n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
              DEC: 28          76 n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
              HEX: 1C          4C n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
This command is to print out y-axis and scale in the direction of cutting paper from left to right.
Parameter n is the spacing between each coordinate point, and the unit is every point. Parameter
Y01 is the highest digit of origin, in the form of hex of ASCII. Parameter Y02-Y0n is the highest
digit of the next coordinate. Parameter 0a is to print the scale this line. Parameter Y11 is the next
digit to the highest digit of origin. Parameter Yn1 is the lowest digit of origin. Parameter 00 is the
end of printing y-axis.
For example: To print a y-axis with 50 dots of the space between. The scale is 00 50 100 150, then
the command:
0x1C 0x4C 50 0x20 0x20 0x31 0x31 0x0a 0x30 0x35 0x30 0x35 0x0a 0x30 0x30 0x30 0x30 0x0a
0x00
3-5-4、【format 1 print x-axis and curve in the direction of feed paper】
Format : ASCII : FS M n k X1 0B X2 0B…Xn 0B 00 m1 C1L C1H..Cm1L
http://www.whkj.com.cn                                                                           - 12 -
                                                                  User’s manual for thermal printer
                        Cm1H …mn CmnL CmnH 00
                DEC : 28 77 n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
                         Cm1H …mn CmnL CmnH 00
                HEX : 1C 4D n k X1 0b X2 0b…Xn 0b 00 m1 C1L C1H Cm1L
                       Cm1H …mn CmnL CmnH 00
This command is to print out x-axis, scale and curve in the direction of feed paper in the left of the
paper. Parameter n is the spacing between each coordinate point, and the unit is every point.
Parameter k is the number of the coordinate scale. Parameter x is the value of scale, The max
digitals is three, with the form of ASCII. For example: the sclae150, need to input 31,35,30.
Parameter 0B is the end of a scale. Parameter M is the number of the curve in one line. Cmnl,
Cmnh is the location of coordinates, Cmnl is the lower byte, CmnH is the higher byte. Parameter
00 is the end of the curve printing.
For example: To print a x-axis with 50 dots of the space between and a beeline with the length of
100 dots in the direction of feed paper and print in the left of the paper, with the scale 50,100. The
command:
0x1c 0x4d 50 0x02 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00 0x01 0x80 0x00(to print a beeline
with the length of 100 dots, the part with underline should be input 100 times.) 0x00 .
3-5-5、【format 2 print y-axis and curve in the direction of cutting paper】
Format: ASCII: FS N k n Y1 0B Y2 0B ….Yn 0B 00
            DEC: 28 78 k n Y1 0B Y2 0B… Yn 0B                         00
            HEX: 1C 4E k n Y1 0B Y2 0B…Yn 0B 00
This command is to print out y-axis and scale in the direction of cutting paper from right to left.
Parameter k is offset to origin. Parameter n is the spacing between each coordinate point, and the
unit is every point. Parameter Y is the value of scale, The maximum digitals is three, with the
form of ASCII. For example: the sclae150, need to input 31, 35, 30. Parameter 0B is the end of a
scale. Parameter 00 express the end of printing y-axis.。
For example: To print a y-axis with 50 dots of the space between. The scale is 00 50 100 150 , and
the offset of origin is 40, then the command:
0x1C 0x4e 40 50 0x20 0x30 0x30 0x0b 0x30 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00.
3-5-6【format 2 print x-axis and curve in the direction of feed paper】
Format : ASCII : FS N n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
                      Cm1H …mn CmnL CmnH 00
             DEC : 28 79 n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
                      Cm1H …mn CmnL CmnH 00
             HEX : 1C 4F n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
                      Cm1H …mn CmnL CmnH 00
This command is to print out x-axis, scale and curve in the direction of feed paper in the right of
the paper. Parameter n is the spacing between each coordinate point, and the unit is every point.
Parameter k is the number of the coordinate scale. Parameter x is the value of scale, The max
http://www.whkj.com.cn                                                                        - 13 -
                                                                  User’s manual for thermal printer
digitals is three, with the form of ASCII. For example: the sclae150, need to input 31,35,30.
Parameter 0B is the end of a scale. Parameter M is the number of the curve in one line. Cmnl,
Cmnh is the location of coordinates, Cmnl is the lower byte, CmnH is the higher byte. Parameter
00 is the end of the curve printing.
For example: To print a x-axis with 50 dots of the space between and a beeline with the length of
100 dots in the direction of feed paper, with the scale 50,100. The command:
0x1c 0x4F 50 0x02 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00 0x01 0x80 0x00 (to print a beeline
with the length of 100 dots, the part with underline should be input 100 times.) 0x00 .
Part 6     Print bar code
3-6-1 Set the size of both the wide and narrow bar
Format:        ASCII: GS      W     n1   n2
                 Dec:  29     87      n1  n2
                 Hex:  1D     57      n1  n2
The size of the narrow bar is n1 dot.
One dot is 1/203 inch or 0.125mm.
initial value is 3.
The size of the wide bar is n2 dot.
3-6-2 Print bar code
Format: ASCII: GS              k    n [d] NUL
            Dec:     29     107     n [d] NUL
            Hex:     1D       6B     n [d] NUL
n is used to choose the bar code system.
                          n       bar
                                  code
                          2       EAN-13
                          3       EAN-8
Please pay attention to the limited number of the bar code system .
Both the EAN-13 and EAN-8 can get the verify number automatically
[d]is the bar code character.
NUL is the end of this command
3-6-3 Permit /forbid printing HRI character
Format: ASCII:      GS      H     n
          Dec:       29    72     n
          Hex:      1D      48      n
When n=0,HRI character will not be printed out and it is the initial value.
When n=1,HRI character will be printed out under the bar code.
3-6-4 Set the height of the bar code
Format: ASCII: GS           h      n
              Dec:  29    104      n
              Hex:  1D      68      n
n=0~255,when n=0,the height is 256 dot.
Default : n=60.
3-6-5    Set the landscape orientation size of the bar code
http://www.whkj.com.cn                                                                       - 14 -
                                                                  User’s manual for thermal printer
Format: ASCII: GS             w      n
             Dec:      29    119     n
              Hex:     1D     77     n
n=1~4, the size of the bar code be different when the n is different. Default : n=3.
                            n    narrow     wide
                                  bar       bar
                            1      1         3
                            2      2         5
                            3      3         7
                            4      4         9
PART 7      Initialization Commands
3-7-1    Initialize Printer
Format: ASCⅡ:           ESC @
              Dec:       27 64
              Hex:       1B 40
Explanation:
This command is used to initialize the printer. There are two ways we can initialize the printer :
(1) use the command ESC @
(2) re-power the printer
Part 8    Data Control Commands
3-8-1     Carriage return
Format: ASCⅡ:          CR
               Dec:    13
               Hex:    0D
Explanation:
 If a “CR” command is sent to printer the total data in the print buffer will be printed out and paper
will be fed for one line forwards.
3-8-2 Allow/forbid printer process data
Format: ASCII: ESC           d    n
          Dec: 27         100      n
          Hex: 1B           64     n
When n=0, forbid the data received,, and all the commands received are of no effect; When n=1,
Allow the data received.
Default n=1
3-8-3 Send the printer state to CPU
Format:       ASCII:    FS        v    n
               Dec:      28     118    n
               Hex:      1C      76     n
Explanation:
This command is only for serial printer. Parameter n means any value. After this command the
printer will send one byte through TXD.
That is the signal of paper-out. When the byte is 0x04, show that the paper is enough; the byte is
0x00, show that the paper is lacking .
http://www.whkj.com.cn                                                                        - 15 -
                                    User’s manual for thermal printer
                 SECTION Ⅳ   Character SetⅠ、Ⅱ
http://www.whkj.com.cn                                         - 16 -
                                                                        User’s manual for thermal printer
          SECTION Ⅳ                       Command table for quick
                                          consultant
                                Commands                                             description
ASCII                   Dec                       Hex
ESC 6 n                 27 54     n               1B 36 n                Select character set
LF                      10                        0A                     Feed line
ESC J n                 27 74 n                   1B 4A n                N dot line feed
ESC 1 n                 27 49     n               1B 31 n                Set n dot line spacing
ESC p n                 27 112 n                  1B 70 n                set the space between characters
ESC B n1 n2…NUL 27 66 n1 n2…0                     1B 42 n1 n2…00         Set Vertical Tab Value
VT                      11                        0B                     Carry out Vertical Tab Value
ESC D n1 n2…NUL 27 68 n1 n2…0                     1B 44 n1 n2…00         Set Horizontal Tab Value
HT                      9                         09                     Carry out Horizontal Tab Value
ESC f m n               27 102 m n                1B 66 m n              Print Blank Character or Lines
ESC Qn                  27    81 n                1B 51 n                Set right margin
ESC 1n                  27 108 n                  1B 6C n                Set left margin
ESC m n                 27 109 n                  1B 6D n                set the gray degree
ESC 7       n           27 55     n               1B 37 n                Enlarge Width
ESC 8       n           27 56     n               1B 38 n                Enlarge Height
ESC : n                 27 58     n               1B 3A n                Select/cancel Chinese Character
ESC - n                 27 45     n               1B 2D n                Select/cancel Underline Print
ESC + n                 27 43     n               1B 2B n                Select/cancel Up-line Print
ESC I       n           27 105 n                  1B 69 n                Select/cancel Reverse White
ESC c n                 27 99     n               1B 63 n                select or cancel reverse print
FS    I     n           28 73 n                   1C 49 n                Set Chinese Character Rotational
ESC & s n m a1 27 38 s n m a1 1B 26 s n m a1
p1[sxa] a2 p2[sxa]      p1[sxa] a2 p2[sxa]         p1[sxa] a2 p2[sxa]    User-defined Characters
FS r      n             28 114 n                  1c 72 n                Select Superscript and Subscript
ESC K ml mh n1 n2...ni. 27 75 ml mh n1 n2...ni... 1B 4B ml mh n1 n2..ni. Print bit-map graphics
ESC V n1 n2 data.1~ 27 86 n1 n2 data.1 ~ 1B 56 n1 n2 data.1 ~ dot line print
data.n2                 data.n2                   data.n2
FS L n Y01 Y02…Y0n 28 76 n Y01Y02…Y0n 0a 1C 4C n Y01 Y02…Y0n format 1 print y-axis and curve in
0a Y11 Y22 Ynn 0a 00 Y11 Y22…Ynn 0a 00 0a Y11 Y22 Ynn 0a 00  the direction of cutting paper
FS M n k X1 0B X2 28 77 n k X1 0B X2 1C 4D n k X10b X2
0B…Xn 0B 00 m1 C1L 0b…Xn 0B 00 m1 C1L 0b…Xn 0b 00 m1 C1L format 1 print x-axis and curve in
C1H..Cm1L Cm1H mn C1H..Cm1L Cm1H …mn C1H Cm1L Cm1H… mn the direction of feed paper
CmnL CmnH 00       CmnL CmnH 00       CmnL CmnH 00
FS N k n Y1 0B 28 78 k n Y1 0B 1C 4E k n Y1 0B format 2 print y-axis and curve in
Y2 0B …Yn 0B 00 Y2 0B…Yn 0B 00        Y2 0B…Yn 0B 00 the direction of cutting paper
FS N n k X1 0B X2 28 79 n k X1 0B X2 1C 4Fn k X10B X2
0b…Xn 0B 00 m1 C1L 0b…Xn 0B 00 m1 C1L 0b…Xn 0B 00 m1 C1L format 2 print x-axis and curve in
C1H..Cm1LCm1H …mn C1H..Cm1L Cm1H …mn C1H..Cm1L Cm1H…mn the direction of feed paper
CmnL CmnH 00       CmnL CmnH 00       CmnL CmnH 00
GS W n1 n2         29 87 n1 n2        1D 57 n1 n2        Set the size of both the wide and
GS k n [d] NUL 29 107 n [d] 00 1D 6B n [d] 00            Print bar code
GS H    n          29 72 n            1b 48 n            Permit/forbid      printing    HRI
GS h n             29 104 n           1D 68 n            Set the height of the bar code
GS w    n          29 119 n           1D 77 n            Set landscape orientation size of
ESC @              27  64             1B 40              Initialize Printer
CR                 13                 0D                 Carriage return
ESC d n            27 100 n           1B 64    n         Allow/forbid printer process data
FS v n             28 118  n          1c 76    n         Send the printer state to CPU
http://www.whkj.com.cn                                                                                - 17 -