Brother RJ-4230B, RJ-4250WB, TD-4410D, TD-4420DN, TD-4510D Software Developer's Manual ESC/P Command Reference Version 2.00

...
Software Developer's Manual
ESC/P Command Reference
RJ-4230B/4250WB
TD-4410D/4420DN/4510D/4520DN/4550DNWB
Version 2.00
The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2019 Brother Industries, Ltd. All rights reserved.
BarStar Pro Encode Library (PDF417, Micro PDF417, DataMatrix, MaxiCode, AztecCode, GS1 Composite, GS1 Databar, Code93, MSI/Plessey, POSTNET, Intelligent Mail Barcode) Copyright (c) 2007 AINIX Corporation. All rights reserved.
QR Code is registered trademark of DENSO WAVE INCORPORATED. QR Code Generating Program Copyright © 2008 DENSO WAVE INCORPORATED
Epson ESC/P is a registered trademark of Seiko Epson Corporation.
Portions of this software are copyright © 2014 The FreeType Project (www.freetype.org). All rights reserved.
Each owner whose software title is mentioned in this document has a Software License Agreement specific to its proprietary programs. Any trade names and product names of companies appearing on Brother products, related documents and any other materials are all trademarks or registered trademarks of those respective companies.

IMPORTANT - PLEASE READ CAREFULLY

Note

This documentation (“Documentation”) provides information that will assist you in controlling your Printer
(Please refer to “Appendix A: Supported Printers”).
You may use the Documentation only if you first agree to the following conditions.
If you do not agree to the following conditions, you may not use the Documentation.

Condition of Use

You may use and reproduce the Documentation to the extent necessary for your own use of your Printer
Model (“Purpose”). Unless expressly permitted in the Documentation, you may not;
(i) copy or reproduce the Documentation for any purpose other than the Purpose,
(ii) modify, translate or adapt the Documentation, and/or redistribute it to any third party,
(iii) rent or lease the Documentation to any third party, or,
(iv) remove or alter any copyright notices or proprietary rights legends included within the Documentation.

No Warranty

a. Any updates, upgrades or alteration of the Documentation or Printer Model will be performed at the sole
discretion of Brother. Brother may not respond to any request or inquiry about the Documentation.
b. THIS DOCUMENTATION IS PROVIDED TO YOU "AS IS" W ITHOUT WARRANTY OF ANY KIND,
WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY
OF FITNESS FOR A PARTICULAR PURPOSE. BROTHER DOES NOT REPRESENT OR WARRANT
THAT THIS DOCUMENTATION IS FREE FROM ERRORS OR DEFECTS.
c. IN NO EVENT SHALL BROTHER BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL,
SPECIAL OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER, ARISING OUT OF
THE USE, INABILITY TO USE, OR THE RESULTS OF USE OF THE DOCUMENTATION OR ANY
SOF TW ARE PROGRAM OR APPLICATION YOU DEVELOPED IN ACCORDANCE WITH THE
DOCUMENTATION.
ESC/P Command Reference
Contents
Introduction ····························································································1 What is ESC/P? ·······················································································2
1. Using ESC/P Commands ······································································3
2. Examples of Using ESC/P Commands ···················································5
3. ESC/P Command Limitations ······························································ 11
3.1 Print area .................................................................................................................. 11
3.2 Characters ................................................................................................................ 13
3.2.1 Character sizes ............................................................................................. 13
3.2.2 Character pitches .......................................................................................... 14
3.3 Print position ............................................................................................................. 15
3.3.1 Characters ..................................................................................................... 15
3.3.2 Bitmaps, barcodes and downloaded images .............................................. 15
3.4 Line feed amount ...................................................................................................... 16
4. Control Code List··············································································· 17
5. Control Command Details ·································································· 21
5.1 Character/style selection commands ...................................................................... 21
ESC R Select international character set ..................................................... 21
ESC q Select character style ........................................................................ 22
ESC k Select font .......................................................................................... 23
ESC t Select character code set ................................................................. 24
5.2 Text printing commands ........................................................................................... 25
ESC 4 Apply italic style ................................................................................. 25
ESC 5 Cancel italic style ............................................................................... 25
ESC E Apply bold s tyle ................................................................................. 26
ESC F Cancel bold style ............................................................................... 26
ESC G Apply double-strike printing............................................................... 27
ESC H Cancel double-strike printing ............................................................ 27
ESC P Apply pica pitch (10 cpi) .................................................................... 28
ESC M Apply elite pitch (12 cpi) .................................................................... 30
ESC g Apply micron pitch (15 cpi)................................................................ 31
ESC p Specify proportional characters ........................................................ 32
ESC W Specify double-width characters....................................................... 32
SO Specify auto-canceling stretched characters ................................... 33
ESC SO Specify auto-canceling stretched characters ................................... 33
SI Specify compressed characters ....................................................... 34
ESC SI Specify compressed characters ....................................................... 34
DC2 Cancel compressed characters ........................................................ 35
DC4 Cancel auto-canceling double-width characters .............................. 35
ESC – Apply/cancel underlining ................................................................... 36
ESC ! Global formatting ............................................................................... 37
ESC SP Specify character spacing ................................................................. 38
ESC X Specify character size ....................................................................... 39
5.3 Line feed commands ................................................................................................ 40
ESC 0 Specify line feed of 1/8 inch .............................................................. 40
ESC 2 Specify line feed of 1/6 inch .............................................................. 40
ESC 3 Specify minimum line feed ................................................................ 41
ESC A Specify line feed of n/60 inch ............................................................ 41
5.4 Horizontal movement commands ............................................................................ 42
ESC l Specify left margin ............................................................................. 42
ESC Q Specify right margin........................................................................... 44
- i ­Introduction
ESC/P Command Reference
CR Carriage return................................................................................... 45
ESC D Specify horizontal tab position .......................................................... 46
HT Perform horizontal tab ....................................................................... 47
ESC $ Specify absolute horizontal position ................................................. 48
ESC \ Specify relative horizontal position ................................................... 48
ESC a Specify alignment .............................................................................. 49
5.5 Vertical movement commands ................................................................................ 50
LF Line feed ............................................................................................ 50
FF Page feed........................................................................................... 50
ESC J Forward paper feed ........................................................................... 51
ESC B Specify vertical tab position .............................................................. 52
VT Perform vertical tab ........................................................................... 53
ESC (V Specify absolute vertical position ..................................................... 54
ESC (v Specify relative vertical position ....................................................... 55
5.6 Paper formatting commands.................................................................................... 56
ESC (c Specify page format .......................................................................... 56
ESC (C Specify page length ........................................................................... 57
5.7 Printer control commands ........................................................................................ 59
ESC @ Initialize .............................................................................................. 59
5.8 Graphics commands ................................................................................................ 60
ESC * Select bit image <for 203dpi printers> ............................................. 60
ESC * Select bit image <for 300dpi printers> ............................................. 64
ESC K 8-dot single-density bit image ........................................................... 70
ESC L 8-dot double-density bit image.......................................................... 71
ESC Y 8-dot double-speed double-density bit i mage .................................. 72
ESC Z 8-dot quadruple-density bit image .................................................... 72
5.9 Advanced commands ............................................................................................... 73
ESC i B Barcode .............................................................................................. 73
ESC i Q 2D barcode (QR Code) ..................................................................... 78
ESC i P QR Code version ............................................................................... 81
ESC i V 2D barcode (PDF417) ....................................................................... 82
ESC i D 2D barcode (DataMatrix) ................................................................... 85
ESC i M 2D barcode (MaxiCode) .................................................................... 88
ESC i J 2D barcode (Aztec) ........................................................................... 90
ESC i G Specify font ........................................................................................ 92
ESC i F P Print downloaded data ...................................................................... 93
ESC i a Switch command mode ..................................................................... 97
ESC i S Status information request ................................................................ 98
ESC i L Specify landscape orientation .........................................................101
ESC i C Specify cutting .................................................................................102
ESC i H Specify recovery setting ..................................................................103
5.10 Advanced static commands .................................................................................104
ESC iXQ2 Select default character style..........................................................104
ESC iXQ1 Retrieve default character style ......................................................105
ESC iXk2 Select default font ............................................................................106
ESC iXk1 Retrieve default font ........................................................................107
ESC iXX2 Specify default character size .........................................................108
ESC iXX1 Retrieve default character size .......................................................109
ESC iX32 Specify default line feed ..................................................................109
ESC iX31 Retrieve default line feed ................................................................ 110
ESC iXA2 Select default alignment .................................................................. 110
ESC iXA1 Retrieve default alignment .............................................................. 111
ESC iX(2 Specify default page length............................................................. 11 2
ESC iX(1 Retrieve default page length ........................................................... 112
ESC iXL2 Select default landscape orientation .............................................. 113
- ii ­Introduction
ESC/P Command Reference
ESC iXL1 Retrieve default landscape orientation ........................................... 11 3
ESC iXj2 Select default international character set ....................................... 114
ESC iXj1 Retrieve default international character set ................................... 115
ESC iXm2 Select default character code set ................................................... 116
ESC iXm1 Retrieve default character code set................................................ 11 7
ESC iXd2 Specify recovery setting .................................................................. 118
ESC iXd1 Retrieve recovery setting ................................................................ 118
ESC iXE2 Specify barcode margin setting ...................................................... 119
ESC iXE1 Retrieve barcode margin setting..................................................... 11 9
ESC iX_2 (00h) Specify line print setting .......................................................120
ESC iX_1 (00h) Retrieve line print setting .....................................................120
ESC iX_2 (01h) Specify line print timeout setting .........................................121
ESC iX_1 (01h) Retrieve line print timeout setting ........................................121
Appendix A: Supported Printers ··························································· 122 Appendix B: Specifications ·································································· 123 Appendix C: Character Code Tables ····················································· 125
Character code tables ..................................................................................................125
International character set table ..................................................................................129
Appendix D: Introducing the Brother Developer Center ························· 130
- iii ­Introduction
ESC/P Command Reference

Introduction

This material provides the necessary information for directly controlling your printer. This information is provided assuming that the user has full understanding of the operating system being used and basic mastery of communication interfaces in a developer's environment. Read the model names that appear in the screens in this manual as the name of your printer.
We accept no responsibility for any problems caused by programs that you develop using the information provided in this material, affecting software, data or hardware, including the printer, and any problems resulting directly or indirectly from them. Use this material only if you accept these terms.
This material shall not be reproduced, in part or in full, without prior approval. In addition, this material shall not be used as evidence in a lawsuit or dispute in a way that is unfavorable towards our company.
These ESC/P commands have been adapted specifically for this company.
- 1 ­Introduction
ESC/P Command Reference

What is ESC/P?

ESC/P is one type of control codes used for printers. With the codes introduced in this document, various labels can be created and printed. In this document, ESC/P codes are provided as both ASCII and binary codes. When sending codes to the printer, make sure that the binary codes are used, otherwise the printer cannot parse the codes.
- 2 -
What is ESC/P?
(1) Start ESC/P
1. Switch the command mode.
2. Initialize
- Switch command mode (ESC i a 0) Note: ESC/P mode
- Initialize (ESC @)
(2) Format settings
1. Select the orientation.
- Specify landscape orientation (ESC i L)
2. Specify the page size.
- Specify page length (ESC ( C)
3. Specify print area.
- Specify page format (ESC ( c)
- Specify left/right margins (ESC I, ESC Q)
4. Specify the line feed amount.
- Specify line feed amount (ESC 0, ESC 2, ESC 3, ESC A)
5. Specify tab positions.
- Specify horizontal tab position (ESC D)
- Specify vertical tab position (ESC B)
(3) Print operations
1. Specify the print position.
- Specify the vertical position (ESC ( v, ESC ( V, VT, ESC J)
2. Transfer the print data (one line).
- Transfer necessary text operation codes (see (4)), bit images, barcodes, and downloaded data (see (5))
3. End of the line.
- Feed the paper (CR, LF)
4. Repeat 1–3 above.
5. End of the page.
- Specify cutting (ESC i C)
- Feed the page (FF)
6. Repeat 1–5 above.
7. End of the document.

1. Using ESC/P Commands

Below is a description of the flow for creating documents. Also refer to “2. Exam ples of Using ESC/P Commands”.
ESC/P Command Reference
- 3 -
1. Using ESC/P Commands
ESC/P Command Reference
(4) Text operations
1. Specify the character set.
- Select font (ESC k)
- Specify the character spacing (ESC P, ESC M, ESC SP)
2. Specify the character style.
- Specify character style
ESC SO, SI, ESC SI, DC2, DC4, ESC -, ESC !)
3. Specify character codes.
Repeat 1–3 above as necessary.
(5) Bit images, barcodes, and
image data
1. Specify bit images.
- (ESC *, ESC K, ESC L, ESC Y, ESC Z)
2. Specify barcodes.
- (ESC i B)
3. Specify 2D barcodes.
- (ESC i Q, ESC i V, ESC i D, ESC i M, ESC i J)
4. Print the downloaded data
- (ESC i F P)
first.
- Select character code (ESC t)
- Select international character set (ESC R)
- Specify character size (ESC X)
(ESC 4, ESC 5, ESC E, ESC F, ESC G, ESC H, ESC W, SO,
An image data has to be transferred and registered to the printer
- 4 -
1. Using ESC/P Commands
Register a media with the Custom Label tool.
Note: The media size to be used is also able to be
output and saved as a command file with the Custom
Label Tool .
Entered Command
ESC i a 00h

2. Examples of Using ESC/P Commands

Set Basic setup first.
Basic setup
1) Register a media to be used.
2) Specify ESC/P command mode.
Basic set up 1: Register a media to be used
ESC/P Command Reference
Basic set up 2: Specify ESC/P command mode
- 5 -
2. Examples of Using ESC/P Commands
5 inches
1 inch
1 inch
Step 1:
Landscape
Step 2:
Page length
Step 3:
Horizontal position
Step 4:
Vertical position
Step 5:
Font type: Helsinki
(proportional pitch
)
Step 6:
Character size: 100 dots
Entered command
ESC i L 01h
This is the label that will be made.
ESC/P Command Reference
In order to make this label, the following six steps are required.
Step
1. Select the landscape orientation
2. Specify the page length
3. Specify the horizontal position
4. Specify the vertical position
5. Select the font type
6. Specify the character size
Step 1: Select the landscape orientation.
- 6 -
2. Examples of Using ESC/P Commands
ESC (C Specify page length
ASCII: ESC
( C nL nH mL mH
Decimal
: 27 40 67 nL nH mL mH
Hexadecimal: 1B 28 43 nL nH mL mH
Parameters
nL=2, nH=0 0mL+mH*256)<8192(for 203dpi printers) 0mL+mH*256<12000(for 300dpi printers)
Description Specifies the page length.
* A page length 0 indicates the Auto setting.
The unit is 1 dot.
Page length=mL+
mH*256
The current paper position is the TOF. The top and bottom m
argins are canceled with ESC ( c.
All previously entered text
is cleared.
A standard unit is not used.
This command is available only with continuous length
tape.
5inches
*The page length does not include the margins.
For the margins, subtract 6 mm (48 dots) from the page length.
nL
nH
mL
mH
ESC ( C 02h 00h C7h 03h
Entered
command
5 inches=101
5 dots
1015 dots–48 dots=967 dots
Page length=mL+mH*256=967
3
03h
199
C7h
Example: A case 203dpi printer is used
1 inch
1 inch=203 dots
Horizontal position=n1+n2*256=203
ESC $ CBh 00h
n1
n2
Entered command
= =
203
CBh
0
00h
= =
Example: A case 203dpi printer is used
Step 2: Specify the page length.
ESC/P Command Reference
Step 3: Specify the horizontal position.
- 7 -
2. Examples of Using ESC/P Commands
1 inch
1 inch=203 dots
Vertical position=mL+mH
*256=
203
109
CB
h
0
00h
ESC ( V 02h 00h CB
h
00h
nL
nH
mL
mH
Entered command
Example: A case 203dpi printer is used
Entered command
ESC k 0Bh
n
n=11=0Bh
Font type: Helsinki
(proportional pitch)
Step 4: Specify the vertical position.
ESC/P Command Reference
Step 5: Select the font type.
- 8 -
2. Examples of Using ESC/P Commands
Character size=nL+nH
*256=100 dots
ESC X 00h 64h
00h
m
nL
nH
Entered command
100
64h
0
00h
Character size
: 100 dots
Example: A case
203dpi
printer is used
Step 6: Specify the character size.
ESC/P Command Reference
- 9 -
2. Examples of Using ESC/P Commands
ESC i a
00h ESC @ ESC i L 01h ESC ( C 02h 00h C7h 03h ESC $
CBh 00h ESC ( V 02h 00h CBh 00h ESC k 0Bh ESC X 00h 64h 00h At your side FF
Select
ESC/P mode
Binary command: 1B 69 61 00
Initialize ESC/P mode
Binary command: 1B 40
6 steps explained above
Print start command
Binary command: 0C
Text to be print
Binary command: 41 74 20 79 6F 75
72 20 73 69 64 65
All commands together will make the example label shown below.
ESC/P Command Reference
However, these commands should be converted to binary data before sent to the printer, as shown below. Here is the captured converted binary data.
When the printer receives above binary commands, the label shown below is printed.
- 10 -
2. Examples of Using ESC/P Commands
ESC/P Command Reference
Unprintable area
Left margin
Right margin
Top margin
Top margin position (TOF position)
Bottom margin
Unprinted area
Print area
Unprintable area

3. ESC/P Command Limitations

3.1 Print area

The printing media are die-cut labels and continuous length tape. The area that can physically be printed on depends on the size and type of the print media.
Die-cut labels
- 11 -
3. ESC/P Command Limitations
Printable area
Left margin
Right margin
Length of printable area
Bottom margin
Top margin
Label length
Label width
Height of
printable area
Label spacing
Thermal head
Print area
* To specify media settings, use the Custom Label Tool. Note: The maximum length of printable area is 3m when a continuous label is used.
ESC/P Command Reference
- 12 -
3. ESC/P Command Limitations
ESC/P Command Reference
Full size
Double width
Double height
Quadruple size
Half width
Double height and half width
Nominal (dots)
16
24
32
48
Height (dots)
15
21
28
44
Width (dots)
8
10
14
44

3.2 Characters

This system uses single-byte character codes and is installed with 6 bitmap fonts (Letter Gothic Bold, Helsinki, Gothic, Brussels, San Diego and Brougham) and 4 outline fonts (Letter Gothic, Brussels, Helsinki and Gothic). Fixed pitch or proportional pitch can be specified for any of the fonts. However, there are fonts that are better with a fixed pitch and fonts that are better with a proportional pitch. The fonts that are better with a fixed pitch are: Letter Gothic and Letter Gothic Bold Brougham. The font that is better with a proportional pitch are: Brussels, Helsinki and Gothic San Diego. Each bitmap font has three sizes or four sizes: 16 dots, 24 dots, 32 dots and 48 dots. Please refer to section AppendixB:Specifications.

3.2.1 Character sizes

Each font is available in full size, compressed size (half width), double width, double height and half width, double height, and quadruple size.
The actual character size is slightly smaller than the nominal size (the parameter value received with the size command). This varies depending on the font.
The above example is for Letter Gothic Bold (full size, no character styles applied).
The line-drawing characters (┘└ ┤─ ├ │ ┼ ┬ ┐┌ , etc.) and shaded characters have their own pitch regardless of the specified font and pitch (proportional or fixed) settings.
- 13 -
3. ESC/P Command Limitations
ESC/P Command Reference
Fixed spacing
c
a
b
c b
a
Fixed
spacing
W
Variable spacing
C
I
W
Variable spacing
C
I
W
Variable spacing
C
I
W
Fixed spacing
C
I
Variable spacing
W
Fixed spacing
C
I
W
C
I

3.2.2 Character pitches

Pitch refers to the spacing between neighboring characters. When characters are arranged with a fixed pitch, they will be evenly spaced. If characters extend over several lines, they will align in straight rows.
When characters are arranged with a proportional pitch, the spacing will vary depending on the character. (For example, “W” is wide but “I” is narrow.) As a result, the excess space between characters is eliminated and the text appears more compact.
If a fixed pitch is applied to a font that is better with a proportional pitch, all characters are given the same width as the widest character in the font.
This makes it possible to evenly space the characters of a proportional-pitch font without having to change the font. If a proportional pitch is applied to a font that is better with a fixed pitch, all characters are given the same width, appearing the same as with a fixed pitch.
- 14 -
3. ESC/P Command Limitations
ESC/P Command Reference
A
Print position
Baseline position
A
Print position
A
A
Baseline position

3.3 Print position

The print position is the standard position for printing characters, bitmaps, and barcodes. There is a horizontal print position and vertical print position, which are the reference points for vertical position movement and horizontal position movement.

3.3.1 Characters

Characters are arranged with their top edges aligned with the print position. The baseline of each character is the bottom edge of the character, regardless of size, font, etc.
All characters on a single line are printed with a baseline positions that is the same for each character. If a single line consists of characters with different heights, the characters are aligned with the baseline of the tallest character on the line.
Underlines are drawn 4 dots below the baseline position.

3.3.2 Bitmaps, barcodes and downloaded images

These types of image data are treated in the same way as characters and are printed with the bottom edge of the image aligned with the baseline.
- 15 -
3. ESC/P Command Limitations
ESC/P Command Reference
Line feed amount
HHHHHHHHHHHHH
HHHHHHHHHHHHH
HHHHHHHHHHHHH

3.4 Line feed amount

The amount of line feed is the amount of vertical movement from the print position of one line to the print position of the next line.
The line feed amount is specified with ESC 0, ESC 2, ESC A, and ESC 3.
Within a single line of text, the tallest character is determined, and the baseline is moved so that the top
edge of that character is at the vertical print position.
The tallest character within a line becomes the line height. If characters are underlined, 4 dots are added to the line height. If the line height is greater than the specified line feed amount, the line height is used as the actual line
feed amount. In this way, even if the specified line feed amount is small, the upper and lower lines will not overlap. (For printer-resident fonts.)
- 16 -
3. ESC/P Command Limitations
ESC/P Command Reference
canceling stretched
characters
Specify auto-canceling stretched characters
Cancel auto-canceling double-width characters

4. Control Code List

Character/style selection commands (Refer to section 5.1 Character/style selection commands.)
Commands Description
RJ-4XXX TD-4XXX
ESC R
ESC q
ESC k
ESC t
Select international character set
Select character style
Select font
Select character code set
Text printing commands (Refer to section 5.2 Text printing commands.)
Commands Description
RJ-4XXX TD-4XXX
ESC 4
ESC 5
ESC E
ESC F
ESC G
ESC H
ESC P
Apply italic style
Cancel italic style
Apply bo ld style
Cancel bold style
Apply double-strike printing
Cancel double-strike printing
Apply pica pitch (10 cpi)
Series
Series
ESC M
ESC q
ESC p
ESC W
SO
ESC SO
SI
ESC SI
DC2
DC4
ESC -
ESC !
ESC SP
ESC X
Apply elite pitch (12 cpi)
Apply micron pitch (15 cpi)
Specify proportional characters
Specify double-width characters Specify auto-
Specify compressed characters
Specify compressed characters
Cancel compressed characters
Apply/cancel underlining
Global formatting
Specify character spacing
Specify character size
- 17 -
4. Control Code List
Specify absolute horizontal position
Line feed commands (Refer to section 5.3 Line feed commands.)
ESC/P Command Reference
Commands Description
Series
RJ-4XXX TD-4XXX
ESC 0
ESC 2
ESC 3
ESC A
Specify line feed of 1/8 inch
Specify line feed of 1/6 inch
Specify minimum line feed
Specify line feed of n/60 inch
Horizontal movement commands (Refer to section 5.4 Horizontal movement commands.)
Series
Commands Description
RJ-4XXX TD-4XXX
ESC l
ESC Q
CR
ESC D
HT
ESC $
Specify left margin
Specify right margin
Carriage return
Specify horizontal tab position
Perform horizontal tab
ESC \
ESC a
Specify relative horizontal position
Specify alignment
Vertical movement commands (Refer to section 5.5 Vertical movement commands.)
Series
Commands Description
RJ-4XXX TD-4XXX
LF
FF
ESC J
ESC B
VT
ESC ( V
ESC ( v
Line feed
Page feed
Forward paper feed
Specify vertical tab position
Perform vertical tab
Specify absolute vertical position
Specify relative vertical position
Paper formatting commands (Refer to section 5.6 Paper formatting commands.)
Series
Commands Description
RJ-4XXX TD-4XXX
ESC ( c Specify page format
ESC ( C Specify page length
- 18 -
4. Control Code List
8-dot double-speed double-density bit image
Printer control comm ands (Refer to section 5.7 Printer control commands.)
ESC/P Command Reference
Commands Description
RJ-4XXX TD-4XXX
ESC @
Initialize (defaults)
Graphics commands (Refer to section 5.8 Graphics commands.)
Commands Description
RJ-4XXX TD-4XXX
ESC *
ESC K
ESC L
ESC Y
ESC Z
Select bit image.
8-dot single-density bit image
8-dot double-density bit image
8-dot quadruple-density bit image
Advanced commands (Refer to section 5.9 Advanced commands.)
Commands Description
RJ-4XXX TD-4XXX
Series
Series
Series
ESC i B
ESC i Q
ESC i P
ESC i V
ESC i D
ESC i M
ESC i J
ESC i G
ESC i F P
ESC i a
ESC i S
ESC i L
ESC i C
ESC i H
Barcode
2D barcode (QR Code)
Specify QR Code version
2D barcode (PDF417)
2D barcode (DataMatrix)
2D barcode (MaxiCode)
2D barcode (Aztec)
Specify font setting
Print downloaded data
Switch command mode
Status information request
Specify landscape orientation
Specify cutting
Specify recovery setting
-
- 19 -
4. Control Code List
orientation
Retrieve default landscape orientation
Select default international character set
Retrieve default international character set
set
Advanced static commands (Refer to section 5.10 Advanced static commands.)
ESC/P Command Reference
Commands Description
ESC iXQ2
ESC iXQ1
ESC iXk2
ESC iXk1
ESC iXX2
ESC iXX1
ESC iX32
ESC iX31
ESC iXA2
ESC iXA1
ESC iX(2
ESC iX(1
ESC iXL2
ESC iXL1
Select default character style
Retrieve default character style
Select default font
Retrieve default font
Specify default character size
Retrieve default character size
Specify default line feed
Retrieve default line feed
Select default alignment
Retrieve default alignment
Specify default page length
Retrieve default page length Select default landscape
Series
RJ-4XXX TD-4XXX
ESC iXj2
ESC iXj1
ESC iXm2
ESC iXm1
ESC iXd2
ESC iXd1
ESC iXE2
ESC iXE1
ESC iX_2 (00h)
ESC iX_1(00h)
ESC iX_2 (01h)
ESC iX_1 (01h)
Select default character code set Retrieve default character code
Specify recovery setting
Retrieve recovery setting
Specify barcode margin setting
Retrieve barcode margin setting
Specify line-print mode
Retrieve line-print mode
Specify line-print timeout
Retrieve line-print timeout
- 20 -
4. Control Code List
ESC/P Command Reference
n=0:
U.S.A.
n=1:
France
n=2:
Germany
n=3:
U.K.
n=4:
Denmark I
n=5:
Sweden
n=6:
Italy
n=7:
Spain I
n=8:
Japan
n=9:
Norway
n=10:
Denmark II
n=11:
Spain II
n=12:
Latin America
n=13:
South Korea
n=64:
Legal

5. Control Command Details

5.1 Character/style selection commands

ESC R Select international character set

ASCII: ESC R n Decimal: 27 82 n
Hexadecimal: 1B 52 n
Parameters
0≤n≤13, 64
Description Selects the character set, and switches some of the character codes in the code table according to the
value of n.
The following 12 codes are switched.
The default setting is n=0 (U.S.A.)
Example
23h, 24h, 40h, 5Bh, 5Ch, 5Dh, 5Eh, 60h, 7Bh, 7Ch, 7Dh, 7Eh
Code: 5Ch ESC R 08h 5Ch FF Print result: \
- 21 -
5. Control Command Details
n=0:
None (normal characters)
n=1:
Outline
n=2:
Shadow
n=3:
Shadow and outline

ESC q Select character style

ASCII: ESC q n Decimal: 27 113 n
Hexadecimal: 1B 71 n
Parameters
0≤n≤3
Description Selects the character style.
ESC/P Command Reference
Example
Code: ABC ESC q 02h ABC ESC q 00h ABC FF Print result: ABC ABC
- 22 -
5. Control Command Details
Bitmap Fonts
Outline Fonts
n=0 Gothic (proportional pitch)
n=8 Gothic (proportional pitch)
n=1 Letter Gothic Bold (fixed pitch)
n=9 Letter Gothic (fixed pitch)
n=2 Brussels (proportional pitch)
n=10 Brussels (proportional pitch)
n=3 Helsinki (proportional pitch)
n=11 Helsinki (proportional pitch)
n=4 San Diego (proportional pitch)
n=5 Brougham (fixed pitch)

ESC k Select font

ASCII: ESC k n Decimal: 27 107 n
Hexadecimal: 1B 6B n
Parameters
0≤n≤5, 8≤n≤11
Description Selects the font.
ESC/P Command Reference
If the font is changed from a bitmap font to outline font, the character size is changed to the default setting
(28 dots).
If the font is changed from an outline font to bitmap font, the character size is changed to default setting
(24 dots).
If the selected font is not supported current size setting, character size is changed to the default setting (24
dots).
Proportional pitched Gothic is forced to be selected when a character assigned from 0x80 to 0xFF in the
Japanese character code table is used. If the character size is set to 48dot, it is not printed.
The state at power-on is according to the setting of ESC iXk 2 (default type setting). Please refer to Appendix B: Specifications.
- 23 -
5. Control Command Details
n=0:
Standard character code set
n=1:
Eastern European character code set
n=2:
Western European character code set
n=3:
Reserved
n=4:
Japanese character code set

ESC t Select character code set

ASCII: ESC t n Decimal: 27 116 n
Hexadecimal: 1B 74 n
Parameters
0≤n≤4
Description From the four built-in character code sets, selects the character code set used.
ESC/P Command Reference
The default setting is n=0. Invalid if n is a value outside of the allowable range.
- 24 -
5. Control Command Details
Loading...
+ 107 hidden pages