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 W Specify double-width characters
- SI Specify compressed characters
- ESC SI Specify compressed characters
- DC2 Cancel compressed characters
- ESC - Apply/cancel underlining
- ESC ! Global formatting
- ESC X Specify character size
- ESC i f Apply/cancel a frame (global)
- CAN Clear text
- DEL Delete one character
- ESC CR Not available
- Line feed commands
- Horizontal movement commands
- Vertical movement commands
- Paper formatting
- Printer control commands
- Graphics commands
- Kanji commands
- Advanced commands
- ESC i B Bar code
- ESC i Q 2D bar code (QR Code)
- ESC i P Specify QR Code version
- ESC i V 2D bar code (PDF417)
- ESC i D 2D bar code (DataMatrix)
- ESC i M 2D bar code (MaxiCode)
- ESC i F Print transferred data
- ESC i a Switch command mode
- ESC i S Request printer status
- ESC i L Apply/cancel rotated printing
- ESC i C Specify cut setting
- ESC i U B Specify baud rate
- ESC i U b Specify bit length
- ESC i U P Specify parity setting
- ESC i U C Specify busy control
- Character code
- BROTHER PT-9800PCN/9700PC ESC/P specifications
47
(*2) With Micro QR, error correction level 4 is invalid, and the default setting is used.
◆
Supplement: About QR Code linkage setting
QR Codes have a linkage setting.
A long character string can be divided into 2 to 16 partitions and printed.
With ESC/P commands, it is necessary to enter only the number of partitions.
For example, enter the bar code data as shown below when the print data is
separated into three partitions.
ESC i Q or q [parameters for 1st set] [1st set of bar code data] \\\
ESC i Q or q [parameters for 2nd set] [2nd set of bar code data] \\\
ESC i Q or q [parameters for 3rd set] [3rd set of bar code data] \\\
3. Linkage setting:
This determines whether or not the bar code data is partitioned. If
the data is not partitioned, enter “0”.
If the data is not partitioned, the values for 4. Code number
, 5. Number of partitions,
and 6. Parity data
are ignored, therefore, enter “0” as a dummy for these parameters.
4. Code number:
This indicates which number the ESC/P command for that QR Code
is for.
For example, if it is the second of four partitions, this value is “2”. If it is the fourth, this
value is “4”.
5. Number of partitions
: For this, enter the number of partitions.
6. Parity data:
This is the value (in bytes) of exclusively OR'ing all print data (print
data before partitioning). Entering the same value as for the partitioned QR Code
ESC/P command indicates that the codes are linked.
About exclusive OR'ing in bytes
Data is exclusively OR'ed (XOR’ed) in bytes and in order.
For example, the hexadecimal values for the character string “1234” are “0x31, 0x32,
0x33, 0x34”.
XOR’ing 0x31 and 0x32 0011 0001 ^= 0011 0010 results in 0000 0011 (0x03)
XOR’ing 0x03 and 0x33 0000 0011 ^= 0011 0011 results in 0011 0000 (0x30)
XOR’ing 0x30 and 0x34 0011 0000 ^= 0011 0100 results in 0000 0100 (0x04)
Therefore, the parity is “0x04”.
Note: If this parity data value is incorrect, an incorrect QR Code is generated.
Summary
Printing the character string “123456789” with a 4-dot cell size, MODEL2, standard error
correction level, and automatic data input










