ESC/ P Command Reference
Table Of Contents
- Control Code List
- Print area
- Characters
- Print position
- Line feed amount
- Document creation flow
- Control command details
- Character/style selection commands
- Text printing commands
- ESC 4 Apply italic style
- ESC 5 Cancel italic style
- ESC E Apply bold style
- ESC F Cancel bold style
- ESC G Apply double-strike printing
- ESC H Cancel double-strike printing
- ESC P Specify pica pitch
- ESC M Specify elite pitch
- ESC g Specify micron pitch
- ESC p Specify proportional characters
- ESC W Specify double width characters
- SO Specify auto-cancelling enlarged characters
- ESC SO Specify auto-cancelling enlarged characters
- SI Specify reduced characters
- ESC SI Specify reduced characters
- DC2 Cancel reduced characters
- DC 4 Cancel auto-cancelling double-width characters
- ESC – Applies/cancels underlining
- ESC ! Global formatting
- ESC SP Specify character spacing
- ESC X Specify character size
- Line feed commands
- Horizontal direction movement commands
- Vertical movement commands
- Paper formatting
- Printer control commands
- Graphics commands
- Advanced commands
- ESC i B Bar code
- ESC i Q 2D Bar code QR codes
- ESC i P QR code version setting
- ESC i V 2D bar code PDF417
- ESC i D 2D bar code DataMatrix control
- ESC i M 2D bar code MaxiCode control
- ESC i F Print downloaded data
- ESC i a Switch command mode
- ESC i S Request printer status
- ESC i L Select landscape orientation
- ESC i C Specify cutting
- ESC iXQ2 Select default character style
- ESC iXQ1 Retrieve default character style
- ESC iXk2 Select default font
- ESC iXk1 Retrieve default font
- ESC iXX2 Specify default character size
- ESC iXX1 Retrieve default character size
- ESC iX32 Specify default line feed
- ESC iX31 Retrieve default line feed
- ESC iXA2 Select default alignment
- ESC iXA1 Retrieve default alignment
- ESC iX(2 Specify default page length
- ESC iX(1 Retrieve default page length
- ESC iXL2 Select default landscape orientation
- ESC iXL1 Retrieve default landscape orientation
- ESC iXj2 Select default international character set
- ESC iXj1 Retrieve default international character set
- ESC iXm2 Select default character code table
- ESC iXm1 Retrieve default character code table
- Character codes
<>
Supplement What is the QR code linkage setting?
With QR codes, there are linkage settings.
A long character string can be partitioned into 2 to 16 partitions and printed.
With the ESC/P command, it is necessary to input only the number of partitions.
For example, if the print data is partitioned into 3 partitions, the bar code data is as
follows:
ESC i Q or q [1
st
parameter] [1
st
set of bar code data] \\\
ESC i Q or q [2
nd
parameter] [2
nd
set of bar code data] \\\
ESC i Q or q [3
rd
parameter] [3
rd
set of bar code data] \\\
3. Linkage Setting: This determines whether or not the bar code data is partitioned with
the linkage setting. When not partitioned, input 0.
When not partitioning, the values of 4 (code number), 5 (number of partitions), and 6
(parity data) are ignored; therefore, input 0 as a dummy value for these parameters.
4. Code number: The code number shows which number the ESC/P command for that
QR code is.
For example, if there are four partitions, for the second ESC/P command, this is 2; for
the fourth ESC/P command, this is 4.
5. Number of partitions: For the number of partitions, input the number of existing
partitions.
6. Parity data is the value of exclusively OR’ing all the print data (print data before
partition) in bytes. The same value is input here as for the partitioned QR code
ESC/P command to show that these codes are linked.
What is exclusive OR’ing in bytes?
The data is exclusively OR’ed (XOR’ed) in bytes and in order.
For example, if the character string is put into hexadecimals, this gives 0x31, 0x32,
0x33, 0x34.
XOR of 0x31 and 0x32 0011 0001 ^= 0011 0010 Result: 0000 0011 (0x03)
XOR of 0x03 and 0x33 0000 0011 ^= 0011 0011 Result: 0011 0000 (0x30)
XOR of 0x30 and 0x34 0011 0000 ^= 0011 0100 Result: 0000 0100 (0x04)
Therefore, the parity is 0x04.
Note: If this parity value is incorrect, the correct QR code is not generated.
Summary
Printing the character string "123456789" with a cell size of 4 dots, Model 2, standard
error correction level, and automatic data input
・No linkage
74
ESC
i Q 0x04 0x02 0x00 0x00 0x00 0x00 0x02 0x00 “123456789”
\\\










