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
PJ-7XX (where “7XX” is the model name).
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" WITHOUT 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
SOFTWARE PROGRAM OR APPLICATION YOU DEVELOPED IN ACCORDANCE WITH THE
DOCUMENTATION.
ESC/P Legacy Command Reference
Contents
Introduction ······················································································ iii
What is ESC/P? ·················································································· iv
1. Using ESC/P Legacy Commands ······················································· v
2. Examples of Using ESC/P Legacy Commands ··································· vii
ESC i a Switch command mode ................................................................. 40
ESC i S Request printer status .................................................................... 41
ESC ~ e F 1 Reverse feed ............................................................................... 41
Appendix A: Character Code Tables ···················································· 42
Character code tables ............................................................................................... 42
Appendix B: Introducing the Brother Developer Center ·························· 45
- ii Introduction
ESC/P Legacy Command Reference
Introduction
This material provides the necessary information for directly controlling PJ-7XX.
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 PJ-7XX, 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 Legacy commands have been adapted specifically for this company.
- iii Introduction
ESC/P Legacy 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
documents 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.
- iv -
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 Legacy mode
- Initialize (ESC @)
(2) Format settings
2. Specify print area.
- Specify left/right margins (ESC I, ESC Q)
3. Specify the line feed amount.
- Specify line feed amount (ESC 0, ESC 2, ESC 3, ESC A)
4. 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 (VT, ESC J)
- Specify the horizontal position (ESC $, ESC \, HT, )
2. Transfer the print data
(one line).
- Transfer necessary text operation codes (see (4)),
bit images, (see (5))
3. End of the line.
- Feed the paper (CR, LF)
4. Repeat 1–3 above.
5. End of the page.
- Feed the page (FF)
6. Repeat 1–5 above.
7. End of the document.
1. Using ESC/P Legacy Commands
Below is a description of the flow for creating documents.
ESC/P Legacy Command Reference
Also refer to “2. Examples of Using ESC/P Legacy Commands
”.
- v -
1. Using ESC/P Legacy Commands
ESC/P Legacy 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
1. Specify bit images.
- (ESC *, ESC K, ESC L, ESC Y, ESC Z)
- Select character code (ESC t)
- Select international character set (ESC R)
(ESC 4, ESC 5, ESC E, ESC F, ESC G, ESC H, ESC W, SO,
- vi -
1. Using ESC/P Legacy Commands
Entered Command
ESC i a 00h
2. Examples of Using ESC/P Legacy Commands
Set Basic setup first.
Basic set up : Specify ESC/P Legacy command mode
ESC/P Legacy Command Reference
- vii -
2. Examples of Using ESC/P Legacy Commands
1 inch
Step 1:
Horizontal position
Step 2:
Font type: Serif
Horizontal position=n+m*256=60
ESC $ 3Ch 00h
n
m
Entered command
= =
60
3Ch
0
00h
= =
1 inch
This is the document that will be made.
ESC/P Legacy Command Reference
In order to make this document, the following two steps are required.
Step 1: Specify the horizontal position.
- viii -
2. Examples of Using ESC/P Legacy Commands
Entered command
ESC k 00h
n
Font type:
Serif
Step 2: Select the font type.
ESC/P Legacy Command Reference
- ix -
2. Examples of Using ESC/P Legacy Commands
ESC i a 00h
ESC @
ESC $ 3Ch 00h
ESC k 00h
At your side
FF
Select ESC/P Legacy mode
Binary command: 1B 69 61 00
Initialize ESC/P mode
Binary command: 1B 40
2 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 document shown below.
ESC/P Legacy 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 document shown below is printed.
- x -
2. Examples of Using ESC/P Legacy Commands
ESC/P Legacy Command Reference
width
Print area
3. ESC/P Legacy Command Limitations
3.1 Print area
[Paper types and sizes]
・ Thermal cut paper: A4/Letter/Legal sizes and any size
・ Thermal roll paper: 210 mm (width)
* Any size is within a range of 210- to 216-mm wide and 25.4- to 567.3-mm long.
[Print area]
The printable area differs depending on the paper type; however, with any paper listed above, the top margin,
left margin and page width of the print area are the same as with A4 paper. If the page length (8-inch page
width) has been specified, the length specified with ESC/P Legacy command will be applied as the page
length.
Paper
length
Page
Top
Bottom
Page
leng
Left
Right margin
mar
gin
Paper
- 1 -
3. ESC/P Legacy Command Limitations
300 dpi (300 × 300) print area (dots)
A4 Letter Legal Any
Paper width 2480 2550 2550 2480 ~ 2550
Paper length 3507 3300 4200 300 ~ 6700
Top margin 30 30 30 30
ESC/P Legacy Command Reference
Bottom margin
3330 3230 4130 230 ~ 6630
Left margin 40 40 40 40
Right margin 2440 2440 2440 2440
Page width 2400 2400 2400 2400
Page length 3300 3200 4100 200 ~ 6600
203 dpi (203 × 200) print area (dots)
A4 Letter Legal Any
Paper width 1680 1727 1727 1680 ~ 1727
Paper length 2338 2200 2800 200 ~ 4467
Top margin 20 20 20 20
Bottom margin
2220 2153 2753 153 ~ 4420
Left margin 27 27 27 27
Right margin 1651 1651 1651 1651
Page width 1624 1624 1624 1624
Page length 2200 2133 2733 133 ~ 4400
[Limitations]
・ Bit image data that extends out of the print area is discarded and not printed. The limitations of the
right margin are not applied to bit images.
・ Character codes that extend past the right margin are printed on the next line as a result of an
overflow line feed.
- 2 -
3. ESC/P Legacy Command Limitations
3.2 Characters
[Font specifications]
Type ANK characters
Font Serif, Sans Serif
Size 10, 12, 15 CPI
Proportional
The conversions from CPI (characters per inch) to dots are shown below.
300 dpi (300 × 300) 203 dpi (203 × 200)
ESC/P Legacy Command Reference
10 CPI 30 × 45 dots 20 × 45 dots
12 CPI 25 × 45 dots 17 × 45 dots
15 CPI 20 × 45 dots 14 × 45 dots
3.3 Resolution
[Resolution conversion]
With ESC/P Legacy, the basic resolution is 360 dpi. However, since the printer resolution is 203 or 300 dpi,
the resolution is converted. The resolution is converted according to the horizontal character position, the
vertical feed amount (line feed amount), bit images, non-standard characters and download fonts.
[Limitations]
The line thickness and position may change since the resolution of bit images is converted in each line and that of non-standard
characters and download fonts is converted when the character is registered.
- 3 -
3. ESC/P Legacy Command Limitations
ASCII Code
Binary Code
Function
CR
0Dh
Carriage return
FF
0Ch
Form feed
LF
0Ah
Line feed
ESC 0
1Bh 30h
Specify line feed of 1/8 inch
ESC 2
1Bh 32h
Specify line feed of 1/6 inch
ESC 3
1Bh 33h
Specify line feed of n/180 inch
ESC A
1Bh 41h
Specify line feed of n/60 inch
ESC +
1Bh 2Bh
Specify line feed of n/360 inch
ESC J
1Bh 4Ah
Specify forward paper feed of n/180 inch
ASCII Code
Binary Code
Function
ESC C
1Bh 43h
Specify page length in lines
ESC C 0
1Bh 43h 00h
Specify page length in inches
ESC N
1Bh 4Eh
Specify skip perforation
ESC O
1Bh 4Fh
Cancel skip perforation
ASCII Code
Binary Code
Function
ESC B
1Bh 42h
Specify vertical tab position
VT
0Bh
Perform vertical tab
ESC D
1Bh 44h
Specify horizontal tab position
HT
09h
Perform horizontal tab
ASCII Code
Binary Code
Function
ESC l
1Bh 6Ch
Specify left margin
ESC Q
1Bh 51h
Specify right margin
BS
08h
Backspace
ESC $
1Bh 24h
Specify absolute position
ESC \
1Bh 5Ch
Specify relative position
4. Control Code List
Paper feed commands (Refer to section 5.1 Paper feed commands.)
ESC/P Legacy Command Reference
Print area setting commands (Refer to section 5.2 Print area setting commands
Tab setting commands (Refer to section 5.3 Tab setting commands
Print position setting commands (Refer to section 5.4 Print position setting commands
.)
.)
.)
- 4 -
4. Control Code List
ESC/P Legacy Command Reference
ASCII Code
Binary Code
Function
ESC k
1Bh 6Bh
Select font
ESC P
1Bh 50h
Specify 10 cpi
ESC M
1Bh 4Dh
Specify 12 cpi
ESC g
1Bh 67h
Specify 15 cpi
ESC p
1Bh 70h
Apply/cancel proportional characters
ESC S
1Bh 53h
Apply superscript/subscript
ESC T
1Bh 54h
Cancel superscript/subscript
ESC t
1Bh 74h
Select character code table
ESC R
1Bh 52h
Select international character set
ASCII Code
Binary Code
Function
ESC x
1Bh 78h
Select text quality
SI, ESC SI
0Fh, 1Bh 0Fh
Specify reduced characters
DC2
12h
Cancel reduced characters
SO, ESC SO
0Eh, 1Bh 0Eh
Specify auto-cancelling double-width characters
DC4
14h
Cancel auto-cancelling double-width characters
ESC W
1Bh 57h
Specify/cancel double-width characters
ESC w
1Bh 77h
Specify/cancel double-height characters
ESC E
1Bh 45h
Apply bold style
ESC F
1Bh 46h
Cancel bold style
ESC G
1Bh 47h
Apply double-strike printing
ESC H
1Bh 48h
Cancel double-strike printing
ESC -
1Bh 2Dh
Apply/cancel underlining
ESC SP
1Bh 20h
Specify character spacing
ESC q
1Bh 71h
Select character style
ESC 4
1Bh 34h
Apply italics
ESC 5
1Bh 35h
Cancel italics
ESC !
1Bh 21h
Global formatting
Character selection commands (Refer to section 5.5 Character selection commands
.)
Character style commands (Refer to section 5.6 Character style commands
.)
- 5 -
4. Control Code List
ASCII Code
Binary Code
Function
ESC & 0
1Bh 26h 00h
Define download characters
ESC %
1Bh 25h
Apply/cancel download character set
ESC : 0
1Bh 3Ah 00h
Copy character set
ESC 6
1Bh 36h
Cancel upper control codes
ESC 7
1Bh 37h
Apply upper control codes
ASCII Code
Binary Code
Function
ESC @
1Bh 40h
Initialize
ASCII Code
Binary Code
Function
ESC K
1Bh 4Bh
8-bit single-density bit image
ESC L
1Bh 4Ch
8-bit double-density bit image
ESC Y
1Bh 59h
8-bit double-speed double-density bit image
ESC Z
1Bh 5Ah
8-bit quadruple-density bit image
ESC *
1Bh 2Ah
Select bit image
ESC ?
1Bh 3Fh
Convert bit image
ESC /
1Bh 2Fh
Select VFU channel
ESC b
1Bh 62h
Specify VFU tab position
ASCII Code
Binary Code
Function
ESC i a
1Bh 69h 61h
Switch command mode
ESC i S
1Bh 69h 53h
Request printer status
ESC ~ e F 1
1Bh 7Eh 65h 46h 01h
Reverse feed
Character definition commands (Refer to section 5.7 Character definition commands
ESC/P Legacy Command Reference
.)
Supplemental function commands (Refer to section 5.8 Supplemental function commands
Others (Refer to section 5.9 Others
.)
Advanced commands (Refer to section 5.10 Advanced commands
.)
.)
- 6 -
4. Control Code List
5. Control Command Details
5.1 Paper feed commands
CR Carriage return
ASCII: CR
Decimal: 13
Hexadecimal: 0D
Function
Returns the cursor position to the left edge.
Details
ESC/P Legacy Command Reference
If automatic line feed has been specified with the utility, a line feed command (LF) is performed after a
carriage return command (CR) is performed.
FF Form feed
ASCII: FF
Decimal: 12
Hexadecimal: 0C
Function
Feeds the paper to the next page separation.
Details
At this time, the SO and ESC SO commands are cancelled.
The feed specifications depend on the specified feed mode.
- 7 -
5. Control Command Details
LF Line feed
ASCII: LF
Decimal: 10
Hexadecimal: 0A
Function
Feeds the paper by one line, according to the specified line feed amount.
Details
At this time, the SO and ESC SO commands are cancelled.
ESC/P Legacy Command Reference
ESC 0 Specify line feed of 1/8 inch
ASCII: ESC 0
Decimal: 27 48
Hexadecimal: 1B 30
Function
Specifies a line feed of 1/8 inch (about 0.32 cm).
- 8 -
5. Control Command Details
ESC 2 Specify line feed of 1/6 inch
ASCII: ESC 2
Decimal: 27 50
Hexadecimal: 1B 32
Function
Specifies a line feed of 1/6 inch (about 0.42 cm).
Details
The default line feed setting is 1/6 inch.
ESC/P Legacy Command Reference
ESC 3 Specify line feed of n/180 inch
ASCII: ESC 3 n
Decimal: 27 51 n
Hexadecimal: 1B 33 n
Function
Specifies a line feed of n/180 inch.
- 9 -
5. Control Command Details
ESC A Specify line feed of n/60 inch
ASCII: ESC A n
Decimal: 27 65 n
Hexadecimal: 1B 41 n
Function
Specifies a line feed of n/60 inch.
Details
The allowable setting range is 0≤n≤85 (55h).
ESC/P Legacy Command Reference
ESC + Specify line feed of n/360 inch
ASCII: ESC + n
Decimal: 27 43 n
Hexadecimal: 1B 2B n
Function
Specifies a line feed of n/360 inch..
ESC J Specify forward paper feed of n/180 inch
ASCII: ESC J n
Decimal: 27 74 n
Hexadecimal: 1B 4A n
Function
Performs a print operation of n/180 inch.
Details
If a page separation is reached while feeding or if there is no more paper, the paper feed amount
outside of the print area is not counted, and the remainder of the feed is performed after entering the
next page.
- 10 -
5. Control Command Details
5.2 Print area setting commands
ESC C Specify page length in lines
ASCII: ESC C n
Decimal: 27 67 n
Hexadecimal: 1B 43 n
Function
Specifies the page length as ((line feed amount when this command is specified) * (n in lines)) inches.
Details
Settings that exceed 22 inches or are less than the sum of the top space (top margin) and bottom
ESC/P Legacy Command Reference
space (page length – bottom margin) are ignored.In addition, skip perforation is cancelled.The default
value is 66 lines. (The default page length is 11 inches.)
ESC C 0 Specify page length in inches
ASCII: ESC C 0 n
Decimal: 27 67 0 n
Hexadecimal: 1B 43 00 n
Function
Specifies the page length as n inches.
Details
Settings that exceed 22 inches or are less than the sum of the top space (top margin) and bottom
space (page length – bottom margin) are ignored.In addition, skip perforation is cancelled.The default
value is 11 inches.
- 11 -
5. Control Command Details
ESC N Specify skip perforation
ASCII: ESC N n
Decimal: 27 78 n
Hexadecimal: 1B 4E n
Function
1≤n≤255
Details
Values that exceed the page length are ignored.The print area is the area remaining when the skip
amount is subtracted from the specified page length.
Cancelled with the ESC O, ESC C or ESC C 0 command.
ESC/P Legacy Command Reference
ESC O Cancel skip perforation
ASCII: ESC O
Decimal: 27 79
Hexadecimal: 1B 4F
Function
Sets the skip amount to 0. (Cancels skip perforation.)
- 12 -
5. Control Command Details
5.3 Tab setting commands
ESC B Specify vertical tab position
ASCII: ESC B n n... NUL
Decimal: 27 66 n n... 0
Hexadecimal: 1B 42 n n... 00
Function
Specifies a vertical tab position.
Details
ESC/P Legacy Command Reference
Specifies a vertical tab at the position where
(line feed amount when this command is specified) * (specified number of lines n).
A maximum of 16 tab positions can be specified.
A tab setting that specifies a position extending past the bottom margin is ignored.
If n = 0, the vertical tabs are cancelled (default), as when the VFU tab is set to channel 0.
VT Perform vertical tab
ASCII: VT
Decimal: 11
Hexadecimal: 0B
Function
Prints the data in the print buffer, and feeds the paper to the next vertical tab position.
Details
Vertical tab position = Line feed amount when this command is specified * Specified number of lines
If the remaining length of paper is not enough to perform a vertical tab, an FF operation is performed
according to the specified form feed mode.
If VT is received when no vertical tabs are specified, an LF operation is performed.
If VT is entered after the vertical tab positions are cleared with ESC B NUL, the operation that is
performed is the same as CR.
The “specify auto-cancelling double-width characters” command is cancelled.
- 13 -
5. Control Command Details
ESC D Specify horizontal tab position
ASCII: ESC D n n... NUL
Decimal: 27 68 n n... 0
Hexadecimal: 1B 44 n n... 00
Function
Specifies a horizontal tab position.
Details
Specifies a horizontal tab at the position where (character width when the tab is performed) * (specified
number of columns) + (left margin position).
Ignored if (character width when this command is specified) * (n columns) + (left margin) extends past
the right margin position.
ESC/P Legacy Command Reference
Horizontal tab settings can be specified between 44h and 00h; settings that exceed the maximum of 32
positions are ignored.
The character width when proportional characters are applied is 10 cpi.
All horizontal tabs are cancelled with ESC D 0.
HT Perform horizontal tab
ASCII: HT
Decimal: 9
Hexadecimal: 09
Function
Moves the print position to the next horizontal tab position.
Details
Horizontal tab position = Character width when the tab is performed * Specified number of columns +
Left margin position.
This command is ignored if there is no space to perform a tab at the right of the current position.
- 14 -
5. Control Command Details
5.4 Print position setting commands
ESC l Specify left margin
ASCII: ESC l n
Decimal: 27 108 n
Hexadecimal: 1B 6C n
Function
Specifies the left margin position as the position from the left edge where (character width when this
command is specified) * n, and specifies the area to the left of this as an unprinted area.
Details
ESC/P Legacy Command Reference
A setting that causes the left margin to be to the right of the right margin is ignored.
Clears the line buffer, and moves the cursor to the left margin position.
The left margin position does not change if the character width is changed after the margin has been
specified.
In addition, this printer operates as an 80-column device, and a setting that extends past 4.5 inches
from the left edge is ignored.
- 15 -
5. Control Command Details
ESC Q Specify right margin
ASCII: ESC Q n
Decimal: 27 81 n
Hexadecimal: 1B 51 n
Function
Specifies the right margin position as the position where (character width when this command is
specified) * n.
Details
A setting that causes the right margin to be to the left of the left margin is ignored.
Clears the line buffer, and moves the cursor to the left margin position.
ESC/P Legacy Command Reference
The right margin position does not change if the character width is changed after the margin has been
specified.
In addition, the print position for the next character is compared with the right margin after one
character is printed, and an overflow line feed is performed if the print position for the next character is
to the right of the right margin.
- 16 -
5. Control Command Details
BS Backspace
ASCII: BS
Decimal: 8
Hexadecimal: 08
Function
Moves the current position in the line buffer back one character.
Details
Two or more BS are ignored.
ESC/P Legacy Command Reference
ESC $ Specify absolute position
ASCII: ESC $ n m
Decimal: 27 36 n m
Hexadecimal: 1B 24 n m
Function
Moves the cursor position to the position (n + m * 256) / 60 inch from the left margin.
Details
However, this is ignored if (n + m *256) is outside of the range 0 to 815 and if the parameter extends
past the right margin.
- 17 -
5. Control Command Details
ESC \ Specify relative position
ASCII: ESC \ n m
Decimal: 27 92 n m
Hexadecimal: 1B 5C n m
Function
Moves the cursor position (n + m * 256) dots to the right or left of the next print position.
Details
Ignored if the position after being moved extends past the left or right margin position.
The movement amount is the number of dots specified as a 2’s complement. This is not underlined.
The dots that the cursor is moved is in units of 1/180 inch or 1/120 inch, and can be switched with the
ESC/P Legacy Command Reference
ESC x setting. (The default is 1/180 inch.)
- 18 -
5. Control Command Details
5.5 Character selection commands
ESC k Select font
ASCII: ESC k n
Decimal: 27 107 n
Hexadecimal: 1B 6B n
Function
Switches the half-width alphanumeric font that is used between “Serif” and “Sans Serif”.
Details
n = 30h, 00h: Serif
ESC/P Legacy Command Reference
n = 31h, 01h: Sans Serif
ESC P Specify 10 cpi
ASCII: ESC P
Decimal: 27 80
Hexadecimal: 1B 50
Function
Uses the character set at 10 cpi.
ESC M Specify 12 cpi
ASCII: ESC M
Decimal: 27 77
Hexadecimal: 1B 4D
Function
Uses the character set at 12 cpi.
etails
The default is 12 cpi.
- 19 -
5. Control Command Details
ESC g Specify 15 cpi
ASCII: ESC g
Decimal: 27 103
Hexadecimal: 1B 67
Function
Uses the character set at 15 cpi.
Details
The “specify reduced characters” is cancelled
ESC/P Legacy Command Reference
ESC p Apply/cancel proportional characters
ASCII: ESC p n
Decimal: 27 112 n
Hexadecimal: 1B 70 n
Function
Applies or cancels proportional characters for alphanumeric characters.
Details
n=00h or 30h: Cancel proportional characters
n=01h or 31h: Apply proportional characters
If a download character set is selected, characters are printed with the width of the defined download
character when proportional characters are applied.
- 20 -
5. Control Command Details
ESC S Apply superscript/subscript
ASCII: ESC S n
Decimal: 27 83 n
Hexadecimal: 1B 53 n
Function
Applies superscript/subscript attributes to alphanumeric characters.
Details
n = 00h or 30h: Apply superscript attribute
The script character is printed raised.
n = 01h or 31h: Apply subscript attribute
The script character is printed lowered.
ESC/P Legacy Command Reference
The character limitations are as described in the manual.
Amount lowered: 20 lines at 300 dpi
13 lines at 203 dpi
ESC T Cancel superscript/subscript
ASCII: ESC T n
Decimal: 27 84 n
Hexadecimal: 1B 54 n
Function
Cancels applied superscript/subscript attributes.
- 21 -
5. Control Command Details
ESC t Select character code table
ASCII: ESC t n
Decimal: 27 116 n
Hexadecimal: 1B 74 n
Function
Selects the character table for character codes 128 through 255.
Details
n = 00h: Select italic characters
n = 01h: Select advanced graphics (default)
ESC/P Legacy Command Reference
* Precautions
Graphics characters (B0h through DFh and F0h through FEh of the advanced graphics code table) are
printed as normal characters.
- 22 -
5. Control Command Details
ESC R Select international character set
ASCII: ESC R n
Decimal: 27 82 n
Hexadecimal: 1B 52 n
Function
Changes a part of the alphanumeric character code table according to the value of n.
Details
00h USA
01h France
02h Germany
03h UK
ESC/P Legacy Command Reference
04h Denmark
05h Sweden
06h Italy
07h Spain
08h Japan
09h Norway
0Ah Denmark II
0Bh Spain II
0Ch Latin America
0Dh Korea
40h Legal
- 23 -
5. Control Command Details
5.6 Character style commands
ESC x Select text quality
ASCII: ESC x n
Decimal: 27 120 n
Hexadecimal: 1B 78 n
Function
Selects draft or high quality for alphanumeric characters.
Details
n = 00h or 30h: Draft mode (1/120" movement amount)
ESC/P Legacy Command Reference
n = 01h or 31h: Letter mode (1/180" movement amount)
Since this printer is not installed with a draft font, the text quality does not change.
However, the setting for this command is used for the units of the movement amount
when the ESC \ command is received.
SI, ESC SI Specify reduced characters
ASCII: ESC SI
Decimal: 27 15
Hexadecimal: 1B 0F
Function
The width of proportional characters is halved (10 cpi→16.67 cpi and 12 cpi → 20 cpi).
Details
Ignored if 15 cpi is specified.
- 24 -
5. Control Command Details
DC2 Cancel reduced characters
ASCII: DC2
Decimal: 18
Hexadecimal: 12
Function
Cancels reduced characters specified with the SI or ESC SI command.
SO, ESC SO Specify auto-canceling double-width characters
ASCII: ESC SO
ESC/P Legacy Command Reference
Decimal: 27 14
Hexadecimal: 1B 0E
Function
Specifies auto-cancelling double-width enlargement for alphanumeric characters.
Details
Cancelled with the DC4, CR, LF, FF, VT or ESC W 0 command.
DC4 Cancel auto-canceling double-width characters
ASCII: DC4
Decimal: 20
Hexadecimal: 14
Function
Cancels auto-cancelling double-width enlargement for alphanumeric characters.
Details
Double-width enlargement specified with ESC W 1 is not cancelled.
- 25 -
5. Control Command Details
ESC W Specify/cancel double-width characters
ASCII: ESC W n
Decimal: 27 87 n
Hexadecimal: 1B 57 n
Function
Specifies or cancels double-width enlargement for alphanumeric characters.
Details
n = 00h or 30h: Cancel double-width enlargement and auto-cancelling double-width enlargement
n = 01h or 31h: Specify double-width enlargement
ESC/P Legacy Command Reference
ESC w Specify/cancel double-height characters
ASCII: ESC w n
Decimal: 27 119 n
Hexadecimal: 1B 77 n
Function
Specifies or cancels double-height enlargement for alphanumeric characters.
Details
n = 00h or 30h: Cancel double-height enlargement
n = 01h or 31h: Specify double-height enlargement
Double-height enlargement is valid with ANK characters. The baseline is lowered 24/180 inch, and the
characters are lengthened vertically.
- 26 -
5. Control Command Details
ESC E Apply bold style
ASCII: ESC E
Decimal: 27 69
Hexadecimal: 1B 45
Function
Applies the bold style to alphanumeric characters.
Details
Characters are shifted 1 bit to the right and OR’ed.
ESC/P Legacy Command Reference
ESC F Cancel bold style
ASCII: ESC F
Decimal: 27 70
Hexadecimal: 1B 46
Function
Cancels the bold style.
- 27 -
5. Control Command Details
ESC G Apply double-strike printing
ASCII: ESC G
Decimal: 27 71
Hexadecimal: 1B 47
Function
Applies double-strike printing to alphanumeric characters.
ESC H Cancel double-strike printing
ESC/P Legacy Command Reference
ASCII: ESC H
Decimal: 27 72
Hexadecimal: 1B 48
Function
Cancels double-strike printing of alphanumeric characters.
- 28 -
5. Control Command Details
ESC – Apply/cancel underlining
ASCII: ESC - n
Decimal: 27 45 n
Hexadecimal: 1B 2D n
Function
Specifies or cancels underlining of alphanumeric characters.
Details
n = 00h or 30h: Cancel underlining
n = 01h or 31h: Apply underlining
Underline position: No character limitations (45th line)
No underlining when the print position is moved with ESC $, ESC \ or HT
ESC/P Legacy Command Reference
ESC SP Specify character spacing
ASCII: ESC SP n
Decimal: 27 32 n
Hexadecimal: 1B 20 n
Function
Specifies the amount of character spacing for alphanumeric characters.
Details
Since the spacing is the remainder from dividing n by 128, 0 to 127 is the normal range of parameters
that are used.
The default is 0.
The units for the spacing are 1/180 inch.
- 29 -
5. Control Command Details
ESC q Select character style
ASCII: ESC q n
Decimal: 27 113 n
Hexadecimal: 1B 71 n
Function
Selects the character style for alphanumeric characters.
Details
n = 00h: Normal characters (default)
n = 01h: Outline
n = 02h: Shadow
n = 03h: Shadow and outline
ESC/P Legacy Command Reference
No character limitations
ESC 4 Apply italic
ASCII: ESC 4
Decimal: 27 52
Hexadecimal: 1B 34
Function
Applies italics to alphanumeric characters.
Details
B0h through DFh as well as F4h and F5h of the advanced graphics code table are printed as normal
characters.
ESC 5 Cancel italic
ASCII: ESC 5
Decimal: 27 53
Hexadecimal: 1B 35
Function
Cancels italics for alphanumeric characters.
- 30 -
5. Control Command Details
ESC ! Global formatting
ASCII: ESC ! n
Decimal: 27 33 n
Hexadecimal: 1B 21 n
Function
Specifies the print mode for alphanumeric characters.
Details
The individual settings are specified according to the description for each command.
With the n values listed below for each of the commands,
the added values only for global formatting are specified.
ESC/P Legacy Command Reference
n value Setting Corresponding command
00h 10 cpi ESC P
01h 12 cpi ESC M
02h Proportional ESC p
04h Reduced SI, DC2
08h Bold (emphasized) ESC E, ESC F
10h Double-strike printing ESC G, ESC H
20h Double width ESC W
40h Italics ESC 4, ESC 5
80h Underline ESC -
- 31 -
5. Control Command Details
5.7 Character definition commands
ESC & 0 Define download characters
ASCII: ESC & 0 n n...
Decimal: 27 38 0 n n...
Hexadecimal: 1B 26 00 n n...
Function
Defines characters that are the same as alphanumeric characters as a download character set.
Details
Converts the resolution of the character line buffer from 180 dpi to 300 dpi or 203 dpi when characters
ESC/P Legacy Command Reference
are defined as 32 dots wide at 300 dpi (21 dots at 203 dpi).
Only high-quality characters can be defined; draft characters can also be defined as high-quality
characters.
Used when applying a download character (ESC % 1).
ESC % Apply/cancel download character set
ASCII: ESC % n
Decimal: 27 37 n
Hexadecimal: 1B 25 n
Function
Applies or cancels the download character set for alphanumeric characters.
Details
n = 00h or 30h: Cancel download character, use font from Flash area
n = 01h or 31h: Apply download character, use font from DRAM area
- 32 -
5. Control Command Details
ESC : 0 Copy character set
ASCII: ESC : 0 n 0
Decimal: 27 58 0 n 0
Hexadecimal: 1B 3A 00 n 00
Function
Copies the font from the Flash memory area to the DRAM area.
ESC 6 Cancel upper control codes
ASCII: ESC 6
ESC/P Legacy Command Reference
Decimal: 27 54
Hexadecimal: 1B 36
Function
Cancels control codes 128 (80h) through 159 (9F).
Details
128 (80h) through 159 (9F) function as character codes
cannot be used as control codes.
ESC 7 Apply upper control codes
ASCII: ESC 7
Decimal: 27 55
Hexadecimal: 1B 37
Function
Details
Applies control codes 128 (80h) through 159 (9F).
128 (80h) through 159 (9F) function as control codes
and cannot be used as character codes.
The default settings are: Cancelled (ESC 6)
- 33 -
5. Control Command Details
5.8 Supplemental function commands
ESC @ Initialize
ASCII: ESC @
Decimal: 27 64
Hexadecimal: 1B 40
Function
Initialize printer
Details
The settings that are stored depend on the setting.
ESC/P Legacy Command Reference
Other items are as listed below.
Beginning of paper: The current paper position is considered as the beginning.
Horizontal print position: Left margin position
Vertical print position: Top margin position
Margin settings: Same settings as the margins for the print area of A4-size page
Horizontal tabs: 8 half-width characters
VFU channel: 0
Page length: 11 inches
Page width: 8 inches
ANK character pitch: 12 cpi
Line feed amount: 1/6 inch
International character set: USA
- 34 -
5. Control Command Details
5.9 Others
ESC K 8-bit single-density bit image
ASCII: ESC K n m ...
Decimal: 27 75 n m...
Hexadecimal: 1B 4B n m...
Function
With the initial settings, same as ESC * 0.
Details
60 dpi bit image data, n = LSB, m = MSB
ESC/P Legacy Command Reference
ESC L 8-bit double-density bit image
ASCII: ESC L n m ...
Decimal: 27 76 n m ...
Hexadecimal: 1B 4C n m ...
Function
With the initial settings, same as ESC * 1.
Details
120 dpi bit image data, n = LSB, m = MSB
The details are as described in the Epson manual.
- 35 -
5. Control Command Details
ESC Y 8-bit double-speed double-density bit image
ASCII: ESC Y n m ...
Decimal: 27 89 n m...
Hexadecimal: 1B 59 n m...
Function
With the initial settings, same as ESC * 2.
Details
120 dpi bit image data, n = LSB, m = MSB
The details are as described in the Epson manual.
ESC/P Legacy Command Reference
- 36 -
5. Control Command Details
ESC Z 8-bit quadruple-density bit image
ASCII: ESC Z n m ...
Decimal: 27 90 n m ...
Hexadecimal: 1B 5A n m ...
Details
240 dpi bit image data, n = LSB, m = MSB
The details are as described in the Epson manual.
ESC * Select bit image
ESC/P Legacy Command Reference
ASCII: ESC * m n1 n2...
Decimal: 27 42 m n1 n2...
Hexadecimal: 1B 2A m n1 n2...
Function
With the initial settings, same as ESC * 3.
Details
The resolution is converted according to the print command after the bit image is expanded in the 360
dpi line buffer.
The size of the 360 dpi line buffer is 2,880 dots × 48 lines. The data for a bit image that exceeds the
buffer area is discarded, and an overflow line feed is not performed. The process for the right margin is
also not performed. In addition, n = 72 is processed in the same way as if n = 73.
- 37 -
5. Control Command Details
ESC ? Convert bit image
ASCII: ESC ? m n
Decimal: 27 63 m n
Hexadecimal: 1B 3F m n
Function
Converts the bit images of ESC K, ESC L, ESC Y and ESC Z to the bit image of parameter n in ESC *.
Details
m refers to the bit image to be converted.
n refers to the bit image to be converted into (m of ESC *).
ESC/P Legacy Command Reference
ESC / Select VFU channel
ASCII: ESC / m
Decimal: 27 47 m
Hexadecimal: 1B 2F m
Function
Selects the VFU channel.
Details
Subsequent VT depend on the vertical tab positions specified with channel m.
- 38 -
5. Control Command Details
ESC b Specify VFU tab position
ASCII: ESC b m n...0
Decimal: 27 98 m n...0
Hexadecimal: 1B 62 m n...00
Function
Specifies a vertical tab position at VFU channel m.
Details
Specifies a vertical tab at the position where (line feed amount when this command is specified) *
(specified number of lines n). A tab setting that specifies a position extending past the page length is
ignored.
ESC/P Legacy Command Reference
- 39 -
5. Control Command Details
5.10 Advanced commands
ESC i a Switch command mode
ASCII: ESC i a n
Decimal: 27 105 97 n
Hexadecimal: 1B 69 61 n
Function
Switches the command mode.
Details
When setting n is:
ESC/P Legacy Command Reference
00h or 30h: ESC/P Legacy / Raster mode (default)
03h or 33h: P-touch Template mode
04h or 34h: ESC/P Brother mode
ASCII: ESC i S
Decimal: 27 105 83
Hexadecimal: 1B 69 53
Function
Requests the printer status.
Details
*Refer to the P-Touch Template Command Reference.
ESC/P Legacy Command Reference
ESC ~ e F 1 Reverse feed
ASCII: ESC ~ e F 1 n m
Decimal: 27 126 101 70 1 n m
Hexadecimal: 1B 7E 65 46 01 n m
Function
Reverse feeds the paper by the specified number of lines.
Details
The number of lines is specified with the two bytes n m.
However, n is the least significant byte and m is the most significant byte.
The setting range for the number of lines is:
At 300 dpi: 24 to 12,000 dots
At 203 dpi: 18 to 8,000 dots
Example: 1Bh 7Eh 65h 46h 01h 04h 10h
Specifies the number of lines as 1004h = 4,100 dots.
- 41 -
5. Control Command Details
∞
Appendix A: Character Code Tables
Character code tables
Advanced graphics code table
MSB
LSB
0 1 2 3 4 5 6 7 8 9 A B C D E F
ESC/P Legacy Command Reference
0
1
2
3
4
5
6
7
8
9
A
B
C
SP0 @ P ` p Ç É á ░└╨α≡! 1 A Q a q ü æ í ▒┴╤ß ±“ 2 B R b r é Æ ó ▓┬╥Γ≥# 3 C S c s â ô ú │├╙π≤$ 4 D T d t ä ö ñ ┤─╘∑⌠% 5 E U e u à ò Ñ ╡┼╒σ⌡& 6 F V f v å û a ╢╞╓µ ÷‘ 7 G W g w ç ù o ╖╟╫ү ≈( 8 H X h x ê ÿ ¿ ╕╚╪Φ˚) 9 I Y i y ë Ö ⌐╣╔┘Θ●* : J Z j z è Ü ¬ ║╩┌Ω•+ ; K [ k { ï ¢ ½ ╗╦█δ√, < L \ l ¦ î £ ¼ ╝╠▄
ⁿ
D
E
F
Precautions
・ The character code 0xF2 is “≤” at 300dpi.
・ The character code 0xF3 is “≥” at 300dpi.
- = M ] m } ì ¥ ¡ ╜═▌Ø ². > N ^ n ~ Ä ₧ « ╛╬▐Є▪/ ? O _ o Å ƒ » ┐╧▀∩ø
- 42 Appendix A: Character Code Tables
\
\
Italic characters code table
MSB
LSB
0 1 2 3 4 5 6 7 8 9 A B C D E F
ESC/P Legacy Command Reference
0
1
2
3
4
5
6
7
8
9
A
B
! 1 A Q a q ! 1 A Q a q
“ 2 B R b r “ 2 B R b r
# 3 C S c s # 3 C S c s
$ 4 D T d t $ 4 D T d t
% 5 E U e u % 5 E U e u
& 6 F V f v & 6 F V f v
‘ 7 G W g w ‘ 7 G W g w
( 8 H X h x ( 8 H X h x
) 9 I Y i y ) 9 I Y i y
* : J Z j z * : J Z j z
+ ; K [ k { + ; K [ k {
SP
0 @ P ` p
C , < L
SP
0 @ P ` p
l ¦ , < L
l ¦
D
E
F
- = M ] m } - = M ] m }
. > N ^ n ~ . > N ^ n ~
/ ? O _ o / ? O _ o ø