ESCP Brother Template Command
ESCP Brother Template Command
BarStar Pro Encode Library (DataMatrix, MaxiCode, PDF417, RSS, CODE93, POSTNET, MSI/Plessey,
AztecCode) Copyright (c) 2007 AINIX Corporation. All rights reserved.
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.
QR Code Generating Program Copyright © 2008 DENSO WAVE INCORPORATED
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
QL-11XX (where “11XX” 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,
(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 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 ······························································ 10
3.1 Print area ............................................................................................... 10
3.2 Characters ............................................................................................. 14
3.2.1 Character sizes .............................................................................................14
3.2.2 Character pitches..........................................................................................15
3.3 Print position .......................................................................................... 16
3.3.1 Characters .....................................................................................................16
3.3.2 Bitmaps, barcodes and downloaded images...............................................16
3.3.3 Same line.......................................................................................................16
3.4 Line feed amount ................................................................................... 17
4. Control Code List··············································································· 18
5. Control Command Details··································································· 22
5.1 Character/style selection commands ..................................................... 22
ESC R Select international character set .....................................................22
ESC q Select character style ........................................................................23
ESC k Select font ..........................................................................................24
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 style .................................................................................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) ....................................................................29
ESC g Apply micron pitch .............................................................................30
ESC p Specify proportional characters ........................................................31
ESC W Specify double-width characters.......................................................31
SO Specify auto-canceling stretched characters ...................................32
ESC SO Specify auto-canceling stretched characters ...................................32
SI Specify compressed characters........................................................33
ESC SI Specify compressed characters........................................................33
DC2 Cancel compressed characters ........................................................34
DC4 Cancel auto-canceling double-width characters ..............................34
ESC – Apply/cancel underlining ...................................................................35
ESC ! Global formatting ...............................................................................36
ESC SP Specify character spacing .................................................................37
ESC X Specify character size .......................................................................38
5.3 Line feed commands.............................................................................. 39
ESC 0 Specify line feed of 1/8 inch ..............................................................39
ESC 2 Specify line feed of 1/6 inch ..............................................................39
ESC 3 Specify minimum line feed ................................................................40
ESC A Specify line feed of n/60 inch ............................................................40
5.4 Horizontal movement commands........................................................... 41
ESC l Specify left margin .............................................................................41
-i-
ESC/P Command Reference
- ii -
ESC/P Command Reference
- iii -
ESC/P Command Reference
Introduction
This material provides the necessary information for directly controlling QL-11XX.
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 QL-11XX, 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?
ESC/P Command Reference
4. Specify the line feed amount. - Specify line feed amount (ESC 0, ESC 2, ESC 3, ESC A)
1. Specify the print position. - Specify the vertical position (ESC ( v, ESC ( V, VT, ESC J)
- Specify the horizontal position (ESC $, ESC \, HT, ESC a)
2. Transfer the print data - Transfer necessary text operation codes (see (4)), bit images,
(one line). barcodes, and downloaded data (see (5))
-3-
1. Using ESC/P Commands
ESC/P Command Reference
-4-
1. Using ESC/P Commands
ESC/P Command Reference
Step 2:
Step 1:
Step 4:
Landscape 0.9 inch
Vertical position
0.5 inch
Step 5:
Step 3: Font type: Helsinki
Horizontal position (proportional pitch)
Step 6:
Character size: 50 dots
In order to make this label, the following six steps are required after entering ESC/P mode.
Entered command n
ESC i L 01h
-5-
2. Examples of Using ESC/P Commands
ESC/P Command Reference
2 inches
2 inches=600 dots
*The page length does not include the margins.
600 dots–72 dots=528 dots
For the margins, subtract 6 mm (72 dots) from the page length.
= =
0.5 inch
150 0
ESC $ 96h 00h
96h 00h
-6-
2. Examples of Using ESC/P Commands
ESC/P Command Reference
0.9 inch
= =
(proportional pitch)
Entered command n
n=11=0Bh
ESC k 0Bh
-7-
2. Examples of Using ESC/P Commands
ESC/P Command Reference
-8-
2. Examples of Using ESC/P Commands
ESC/P Command Reference
All commands together will make the example label shown below.
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.
-9-
2. Examples of Using ESC/P Commands
ESC/P Command Reference
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
Unprintable area
Space above
physically printable
area
Physically printable
area
Left margin
- 10 -
3. ESC/P Command Limitations
ESC/P Command Reference
(9) Label
(2) Label length spacing
No.1296
(3) Top margin
Thermal head
printable area
(7) Height of
(1) Label width
Printable area
(5) Left margin (8) Length of printable area (6) Right margin
No.001
Standard Address 1 No 29mm 90.3mm 1.5mm 3mm 25.92mm 83.94mm 941 – 1246
Large Address 2 No 38mm 90.3mm 1.5mm 3mm 34.98mm 83.94mm 828 - 1240
Small Address 3 No 62mm 28.93mm 1.5mm 3mm 58.95mm 22.95mm 545 – 1240
Multi purpose 5 No 17mm 54.32mm 1.5mm 3mm 13.98mm 47.94mm 1088 – 1252
File Folder 6 No 17mm 87.13mm 1.5mm 3mm 13.98mm 80.97mm 1088 – 1252
CD/DVD (MKP) 7 Yes 58.29mm 58.29mm 3mm 3mm 52.26mm 52.26mm 585 – 1201
Continuous Length
Paper 62 Postage
11 No 62mm - 1.5mm 3mm 58.95mm - 545 - 1240
Print
(only for U.S.A)
Square Paper
12 No 23.0mm 23.03mm 1.5mm 3mm 19.99mm 17.11mm 976 - 1211
(23mm)
- 11 -
3. ESC/P Command Limitations
ESC/P Command Reference
Head-
Sensor Applied Drive
(1) (2) (3) (4) (5) (6) (7) (8)
No. Forced Head No.
segmenting
Postage Print
14 No 32.9mm 47.62mm 1.5mm 3mm 29.9mm 41.59mm 858 – 1210
(only for U.S.A)
Round Paper 17 No 12.0mm 12.0mm 2mm 2mm 7.96mm 7.96mm 1047 – 1140
Round Paper 18 No 24.0mm 24.0mm 2mm 2mm 19.99mm 19.99mm 976 – 1211
Continuous Length
19 No 38mm - 1.5mm 3mm 34.98mm - 828 – 1240
Paper (38mm)
Continuous Length
20 No 29mm - 1.5mm 3mm 25.92mm - 941 – 1246
Paper (29mm)
Continuous Length
21 No 62mm - 1.5mm 3mm 58.95mm - 545 – 1240
Paper (62mm)
Continuous Length
22 Yes 29mm - 1.5mm 3mm 25.92mm - 941 – 1246
Film-White (29mm)
Continuous Length
23 Yes 62mm - 1.5mm 3mm 58.95mm - 545 – 1240
Film-White (62mm)
Continuous Length
24 Yes 62mm - 1.5mm 3mm 58.95mm - 545 – 1240
Film-Yellow (62mm)
Continuous Length
25 Yes 62mm - 1.5mm 3mm 58.95mm - 545 – 1240
Film-Clear (62mm)
Continuous Length
26 No 12mm - 1.5mm 3mm 8.98mm - 1117 – 1222
Paper (12mm)
Continuous Length
27 No 50 mm - 1.5mm 3mm 46.92mm - 687 – 1240
Paper (50mm)
Continuous Length
2.5mm/
Non-Adhesive 28 Yes 54mm - 3mm 49.97mm - 663 – 1252
1.5mm
Paper (54mm)
- 12 -
3. ESC/P Command Limitations
ESC/P Command Reference
Head-
Sensor Applied Drive
(1) (2) (3) (4) (5) (6) (7) (8)
No. Forced Head No.
segmenting
Continuous Length
39 No 103.6 mm - 1mm 3mm 101.64mm - 59 – 1258
Paper (103mm)
Continuous Length
57 No 101.6 mm - 1.5mm 3mm 98.59mm - 77 – 1240
Paper (102mm)
- 13 -
3. ESC/P Command Limitations
ESC/P Command Reference
3.2 Characters
This system uses single-byte character codes and is installed with five bitmap fonts (Brougham, Letter Gothic
Bold, Brussels, Helsinki and San Diego) as well as three outline fonts (Letter Gothic Bold, Brussels and
Helsinki.
Fixed pitch or proportional pitch (PS 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 (PS
pitch).
The fonts that are better with a fixed pitch are: Brougham and Letter Gothic Bold.
The fonts that are better with a proportional pitch are: Brussels, Helsinki and San Diego.
Each of the five bitmap fonts has three sizes: 24 dots, 32 dots and 48 dots.
Each font is available in full size, compressed size (half width), double width, double height and half width,
double height, and quadruple size.
Full size Half width Double width Double height Double height Quadruple size
and half width
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.
Nominal (dots) 24 32 48
Height (dots) 21 28 44
Width (dots) 11 16 26
The above example is for Brougham (full size, no character styles applied).
The line-drawing characters (┘└ ┤─ ├ │ ┼ ┬ ┐┌ , etc.) and shaded characters have the Brougham font
applied regardless of the specified font and pitch (proportional or fixed) settings.
- 14 -
3. ESC/P Command Limitations
ESC/P Command Reference
abc a b c
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.
I W C I W C
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.
IW C I W C
I W C I W C
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.
- 15 -
3. ESC/P Command Limitations
ESC/P Command Reference
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.
Print position
A Baseline position
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.
Print position
A A A Baseline position
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.
Characters and images are considered to be on the same line, even if they are separated by tabs.
Horizontal movement to the right between characters or images is regarded as being on the same line;
however, horizontal movement to the left is regarded as being on separate lines if wrapping occurs.
- 16 -
3. ESC/P Command Limitations
ESC/P Command Reference
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.
- 17 -
3. ESC/P Command Limitations
ESC/P Command Reference
- 18 -
4. Control Code List
ESC/P Command Reference
- 19 -
4. Control Code List
ESC/P Command Reference
- 20 -
4. Control Code List
ESC/P Command Reference
- 21 -
4. Control Code List
ESC/P Command Reference
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.
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
The following 12 codes are switched.
23h, 24h, 40h, 5Bh, 5Ch, 5Dh, 5Eh, 60h, 7Bh, 7Ch, 7Dh, 7Eh
The default setting is n=0 (U.S.A.)
Example
Code: 5Ch ESC R 08h 5Ch FF
Print result: \ ¥
- 22 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC q n
Decimal: 27 113 n
Hexadecimal: 1B 71 n
Parameters
0≤n≤3
Description
Selects the character style.
n=0: None (normal characters)
n=1: Outline
n=2: Shadow
n=3: Shadow and outline
Example
Code: ABC ESC q 03h ABC ESC q 00h ABC FF
ABCABC
Print result: ABCA
- 23 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC k n
Decimal: 27 107 n
Hexadecimal: 1B 6B n
Parameters
0≤n≤4, 9≤n≤11
Description
Selects the font.
Bitmap Fonts Outline Fonts
n=1 Letter Gothic Bold (fixed pitch) n=10 Brussels (proportional pitch)
ASCII: ESC t n
Decimal: 27 116 n
Hexadecimal: 1B 74 n
Parameters
n=0, 1, 2
Description
From the three built-in character code sets, selects the character code set used.
n=0: Standard character code set
n=1: Eastern European character code set
n=2: Western European character code set
n=3: (Reserved)
The default setting is n=2.
- 24 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC 4
Decimal: 27 52
Hexadecimal: 1B 34
Parameters
None
Description
Prints the subsequent text in italics.
This command is valid anywhere in a text line.
ASCII: ESC 5
Decimal: 27 53
Hexadecimal: 1B 35
Parameters
None
Description
Cancels the italic character style.
This command is valid anywhere in a text line.
Example
Code: ABC ESC 4 DEF ESC 5 GHI FF
Print result: ABCDEFGHI
- 25 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC E
Decimal: 27 69
Hexadecimal: 1B 45
Parameters
None
Description
Prints the subsequent text in bold.
This command is valid anywhere in a text line.
ASCII: ESC F
Decimal: 27 70
Hexadecimal: 1B 46
Parameters
None
Description
Cancels the bold style.
This command is valid anywhere in a text line.
Example
Code: ABC ESC E DEF ESC F GHI FF
Print result: ABCDEFGHI
- 26 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC G
Decimal: 27 71
Hexadecimal: 1B 47
Parameters
None
Description
Prints the subsequent text in bold.
This command is valid anywhere in a text line.
ASCII: ESC H
Decimal: 27 72
Hexadecimal: 1B 48
Parameters
None
Description
Cancels the bold style.
This command is valid anywhere in a text line.
Example
Code: ABC ESC G DEF ESC H GHI FF
Print result: ABCDEFGHI
- 27 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC P
Decimal: 27 80
Hexadecimal: 1B 50
Parameters
None
Description
Prints the subsequent text with the pica pitch (10 characters/inch).
The character spacing is 30 dots (=300 dots/10 characters).
If the character width is 30 dots or less, the character spacing is specified as 30 minus the character width.
If the character width exceeds 30 dots, the character spacing is specified as the character width.
(The spacing between characters is 0 dot.)
In this case, the pitch does not exactly equal the pica pitch.
With double-width characters, the character spacing is doubled (60 dots).
With half-width characters, the character spacing is halved (15 dots).
When the character spacing is changed with ESC SP, the setting is updated.
This command is invalid when proportional pitch is selected.
In outline fonts, the spacing between characters is 0 dot.
Full Width Double Width Half Width
Setting (dots)
24 32 48 24 32 48 24 32 48
Brougham 11 16 26 22 32 52 6 8 13
Letter Gothic
10 14 22 20 28 44 5 7 11
Width (dots)
Bold
Brussels 25 35 56 50 70 112 13 18 28
Helsinki 21 28 44 42 56 88 11 14 22
Example
For a 24-dot font at full width:
A B A B
6 dots 12 dots
- 28 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC M
Decimal: 27 77
Hexadecimal: 1B 4D
Parameters
None
Description
Prints the subsequent text with the elite pitch (12 characters/inch).
The character spacing is 25 dots (=300 dots/12 characters).
If the character width is 25 dots or less, the character spacing is specified as 25 minus the character width.
If the character width exceeds 25 dots, the character spacing is specified as the character width.
(The spacing between characters is 0 dot.)
In this case, the pitch does not exactly equal the elite pitch.
With double-width characters, the character spacing is doubled (50 dots).
With half-width characters, the character spacing is halved (13 dots).
When the character spacing is changed with ESC SP, the setting is updated.
This command is invalid when proportional pitch is selected.
In outline fonts, the spacing between characters is 0 dot.
Example
For a 24-dot font at full width:
A B A B
1 dot 2 dots
- 29 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC g
Decimal: 27 103
Hexadecimal: 1B 67
Parameters
None
Description
Prints the subsequent text with the micron pitch (15 characters/inch).
The character spacing is 20 dots (=300 dots/15 characters).
If the character width is 20 dots or less, the character spacing is specified as 20 minus the character width.
If the character width exceeds 20 dots, the character spacing is specified as the character width.
(The spacing between characters is 0 dot.)
In this case, the pitch does not exactly equal the micron pitch.
With double-width characters, the character spacing is doubled (40 dots).
With half-width characters, the character spacing is halved (10 dots).
When the character spacing is changed with ESC SP, the setting is updated.
This command is invalid when proportional pitch is selected.
In outline fonts, the spacing between characters is 0 dot.
Example
For a 11-dot font at full width:
A B A B
9 dot 18 dots
- 30 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC p n
Decimal: 27 112 n
Hexadecimal: 1B 70 n
Parameters
n=0, 1, 48 (“0”), 49 (“1”)
Description
Specifies proportional characters.
n=1 or 49 (“1”): Specifies proportional characters.
n=0 or 48 (“0”): Cancels proportional characters.
If proportional characters are specified, the character spacing specified with ESC SP is maintained as is.
ASCII: ESC W n
Decimal: 27 87 n
Hexadecimal: 1B 57 n
Parameters
n=0, 1 or 48 (“0”), 49 (“1”)
Description
Specifies double-width characters.
n=1 or 49 (“1”): Specifies double-width characters.
n=0 or 48 (“0”): Cancels double-width characters.
Double-width characters specified with this command are not canceled with the DC4 code or a line feed.
Canceling double-width characters also cancels compressed (half-width) characters.
Example
Code: ABC ESC W 1 ABC ESC W 0 ABC FF
Print result: ABCABCABC
- 31 -
5. Control Command Details
ESC/P Command Reference
ASCII: SO
Decimal: 14
Hexadecimal: 0E
Parameters
None
Description
Prints the subsequent text at double width.
This command is canceled with DC4, LF, VT, FF, CR or an automatic line feed.
This command is canceled with ESC $, ESC \, ESC J, ESC ( V or ESC ( v.
This command can also be canceled with ESC W+0.
ASCII: ESC SO
Decimal: 27 14
Hexadecimal: 1B 0E
Parameters
None
Description
Same as SO
Example
Code: ABC ESC SO ABCDEFGHIJK…XYZ FF
Print result: ABCABCDEFGHIJK…(Automatic line feed)
XYZ
- 32 -
5. Control Command Details
ESC/P Command Reference
ASCII: SI
Decimal: 15
Hexadecimal: 0F
Parameters
None
Description
Prints the subsequent text at half width.
ASCII: ESC SI
Decimal: 27 15
Hexadecimal: 1B 0F
Parameters
None
Description
Same as SI
- 33 -
5. Control Command Details
ESC/P Command Reference
ASCII: DC2
Decimal: 18
Hexadecimal: 12
Parameters
None
Description
Cancels compressed characters specified with SI or ESC SI.
ASCII: DC4
Decimal: 20
Hexadecimal: 14
Parameters
None
Description
Cancels double-width characters specified with ESC SO or SO.
Does not cancel the ESC W command.
Example
Code: ABC ESC SO ABCDEF DC4 GHIJK FF
Print result: ABCABCDEFGHIJK
- 34 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC - n
Decimal: 27 45 n
Hexadecimal: 1B 2D n
Parameters
n=0, 1, 2, 3, 4 or 48 (“0”), 49 (“1”), 50 (“2”), 51 (“3”), 52 (“4”)
Description
Applies or cancels underlining.
n=4 or 52 (“4”): Applies underlining with a width of 4 dots.
n=3 or 51 (“3”): Applies underlining with a width of 3 dots.
n=2 or 50 (“2”): Applies underlining with a width of 2 dots.
n=1 or 49 (“1”): Applies underlining with a width of 1 dot.
n=0 or 48 (“0”): Cancels underlining.
This command is valid anywhere in a text line.
The underlining specified with this command is a continuous line.
Spaces between characters and words are also underlined.
Areas with the “specify absolute horizontal position” (ESC $) and “specify relative horizontal position”
(ESC \) commands are not underlined.
Bit images and barcodes are not underlined either.
4/300 inch (4 dots) is added to the line feed amount for lines that include underlined characters.
The underline is positioned as follows:
Underline Underline Position
2 dots wide Between 2/300 inch (second dot) and 3/300 inch (third dot) below the characters
3 dots wide Between 1/300 inch (first dot) and 3/300 inch (third dot) below the characters
4 dots wide Between 1/300 inch (first dot) and 4/300 inch (fourth dot) below the characters
Example
Code: ABC ESC - 1 ABC ESC - 0 ABC FF
Print result: ABCABCABC
- 35 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC ! n
Decimal: 27 33 n
Hexadecimal: 1B 21 n
Parameters
0≤n≤255
Description
Specifies a combination of print modes.
Specifies modes depending on the bit value of n.
When the ESC ! code is used, a combination of multiple print modes can be specified at one time.
The priority order is from Bit 5 to Bit 2.
Bit 0 is available only if Bit 1 is 0.
Selected character styles are canceled, and the characters return to the normal style.
Canceling double-width characters also cancels compressed (half-width) characters.
Bit 7 6 5 4 3 2 1 0
Double Double
1 Underline Italics Bold Compressed Proportional 12 cpi
width height
0 Cancel Cancel Cancel Cancel Cancel Cancel Cancel 10 cpi
Example
To apply underlining and specify double-width characters at the same time:
Code: ABC ESC ! A0h ABC ESC ! 00h ABC FF
Print result: ABCABCABC
- 36 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC SP n
Decimal: 27 32 n
Hexadecimal: 1B 20 n
Parameters
0≤n≤127
Description
Specifies the character spacing.
n indicates the number of dots.
The default setting is 0 dot.
With double-width characters, the character spacing is doubled; with half-width characters, it is halved.
- 37 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC X m nL nH
Decimal: 27 88 m nL nH
Hexadecimal: 1B 58 m nL nH
Parameters
Character width: The value of m is irrelevant.
Character size: <Bitmap fonts> <Outline fonts>
Valid only with: Valid only with:
nL=24, 32, 48 dots nL=33, 38, 42, 46, 50, 58, 67, 75, 83,
nH=0 92, 100, 117, 133, 150, 167, 200, 233
nH=0
nL=11, 44, 77, 111, 144
nH=1
Description
This command is used only to change the size.
Outline must not be specified.
The character width cannot be specified.
The character size is specified as n=nL+nH*256 dots.
The width and the height are the same.
With bitmap fonts, only n=24, 32 and 48 are valid.
With outline fonts, n is valid only when it is one of the following values:
33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200, 233, 267, 300, 333, 367, 400
The commands for specifying stretched characters, compressed characters and the character spacing
(SO, ESC W, SI, ESC !, ESC SP) remain available.
Example
For “ABC” at a 24-dot size and “DEF” at a 50-dot size:
Code: ESC k 01h
ESC X 00h 18h 00h ABC
ESC k 09h
ESC X 00h 32h 00h DEF FF
- 38 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC 0
Decimal: 27 48
Hexadecimal: 1B 30
Parameters
None
Description
Specifies a line feed of 1/8 inch (about 0.32 cm).
Specifies a line feed of 38/300 inch (=38 dots).
ASCII: ESC 2
Decimal: 27 50
Hexadecimal: 1B 32
Parameters
None
Description
Specifies a line feed of 1/6 inch (about 0.42 cm).
Specifies a line feed of 50/300 inch (=50 dots).
- 39 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC 3 n
Decimal: 27 51 n
Hexadecimal: 1B 33 n
Parameters
0≤n≤255
Description
Specifies a line feed of n/300 inch per line.
The line feed is specified in 1-dot units.
ASCII: ESC A n
Decimal: 27 65 n
Hexadecimal: 1B 41 n
Parameters
0≤n≤255
Description
Specifies a line feed of n/60 inch.
The line feed is specified in 5-dot units.
- 40 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC l n
Decimal: 27 108 n
Hexadecimal: 1B 6C n
Parameters
0≤n≤255
0≤left margin<right margin
Description
The left margin and the right margin use the left edge of the physically printable area as the reference.
The area between the left edge of the physically printable area and the specified number of columns is
specified as an unprinted area. The left margin position is the right edge of the specified column.
(Character width*n)
The setting is in the range 0≤ (character width*n) ≤x. Settings outside that range are ignored. However, x is
a value dependent on the media.
The area between the left edge (first column) to the nth column is specified as an unprinted area.
The position of the left margin is the character width (when this command was specified)*n from the left
edge.
The character width when the margin specified includes the settings for the character spacing. In addition,
when a pitch of 10 cpi (=30 dots), 12 cpi (=25 dots) or 15cpi (=20 dots), compressed characters or
double-width characters are specified, that character width is considered as the unit.
However, character styles that increase the character width are not applied.
Printable area
- 41 -
5. Control Command Details
ESC/P Command Reference
Example
To specify the left margin at Column 3:
Code: ABC CR ESC l 03h EFGHIJ FF
Print result: ABC
EFGHIJ
- 42 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC Q n
Decimal: 27 81 n
Hexadecimal: 1B 51 n
Parameters
1≤n≤255
Left margin<character width (when the command was specified)*n≤printable area
Description
The left margin and the right margin use the left edge of the physically printable area as the reference.
The right margin position is the right edge of the specified column. (Character width*n)
The setting is in the range 1≤(character width*n)≤x. Settings outside that range are ignored. However, x is
a value dependent on the media.
Left margin≤print area<right margin
The position of the right margin is the character width (when the command was specified)*n from the left
edge.
The character width when the margin is specified includes the settings for the character spacing. In
addition, when a pitch of 10 cpi (=30 dots), 12 cpi (=25 dots) or 15 cpi (=20 dots), compressed characters
or double-width characters are specified, that character width is considered as the unit.
However, character styles that increase the character width are not applied.
The horizontal print position is moved to the left margin position.
If the right margin setting is not at the beginning of the line, the right margin is specified after a line feed.
The beginning of the line indicates the left margin position for left alignment; for right and center
alignment, it means that no image or character is entered on the line.
Even if the character width is changed after the right margin has been specified, the right margin position
does not change.
A right margin setting that puts the right margin position to the left of the left margin position is ignored.
The right margin should be specified at least one column (10 cpi=30 dots) greater than the left margin.
(If the character width (when the command was specified)*n is less than the left margin+30 dots, the
setting is ignored.)
If the difference between the right margin position and the left margin position is less than one character,
that character is ignored.
When proportional pitch is specified with the ESC p command, a character width of 10 cpi (=30 dot) is
applied.
If the print media is continuous length tape, the printing orientation is landscape and the page length is not
specified, commands specifying the right margin are ignored.
- 43 -
5. Control Command Details
ESC/P Command Reference
CR Carriage return
ASCII: CR
Decimal: 13
Hexadecimal: 0D
Parameters
None
Description
Ends input of a line, and waits for input of the next line.
The next print position becomes the beginning of the next line.
A line feed command immediately after the carriage return is ignored.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
Same process as LF
- 44 -
5. Control Command Details
ESC/P Command Reference
Parameters
1≤n≤255, 0≤k≤32
Description
The horizontal tab position is the character width (when the command was specified)*n from the left
margin.
Enter n values in ascending order and end the settings with NUL.
If an n value is smaller than a previous one, tab setting is ended.
Even if the character width is changed after the horizontal tab positions have been specified, the horizontal
tab position settings do not change.
ESC D NUL cancels all horizontal tab positions.
If the left margin is moved, the horizontal tab positions are also moved by the same amount.
Up to 32 horizontal tab positions can be specified. However, horizontal tab positions beyond the right
margin are invalid and only become valid when a change in the right margin setting or left margin setting
moves the print area to include those tab positions.
The character width when the horizontal tabs are specified includes the settings for the character spacing.
In addition, when a pitch of 10 cpi, 12 cpi or 15 cpi compressed characters or double-width characters are
specified, that character width is considered as the unit.
When proportional pitch is specified with ESC p, horizontal tab positions are specified at 10 cpi.
When the printer is turned on, a horizontal tab position is specified every 8 columns at 10 cpi.
Even if the character width is changed before the horizontal tab positions has been specified, the
horizontal tab positions do not change.
Left edge Left margin position Tab position Tab position Right margin position
Column 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14
HT code HT code
Example:
After the left margin is specified as Column 3 and the right margin as Column 15,
horizontal tabs were specified at Column 5 and Column 10, and HT were performed.
- 45 -
5. Control Command Details
ESC/P Command Reference
ASCII: HT
Decimal: 9
Hexadecimal: 09
Parameters
None
Description
Moves the horizontal print position to the nearest horizontal tab position to the right of the input position.
If there is no horizontal tab position to the right of the input position, or if the next horizontal tab position is
beyond the right margin, the HT command is ignored.
If underlining is specified, the space between the current position and the next horizontal tab position is not
underlined.
When the printer is turned on, a horizontal tab position is specified every 8 columns at 10 cpi.
Even if the character width is changed before the horizontal tab positions have been specified, the
horizontal tab positions do not change.
This command is available only with left alignment.
Example
To specify horizontal tabs at Column 4, Column 8, and Column 12, and perform horizontal tabs:
Code: ESC D 04h 08h 0Ch 00h
123456789012 CR A HT B HT C HT D FF
Print result: 123456789012
A B C D
- 46 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC $ n1 n2
Decimal: 27 36 n1 n2
Hexadecimal: 1B 24 n1 n2
Parameters
0≤n1≤255, 0≤n2≤255
Description
Specifies the absolute print position (in dots) for the next data.
An absolute print position specifies the next print position as a number of dots from the left margin.
n1 and n2 indicate the number of dots from the left margin.
(Number of dots=n1+n2*256)
The dot spacing is calculated as 1/300 inch.
The maximum number of dots that can be specified with n1 and n2 depends on the media.
This command is available only with left alignment.
ASCII: ESC \ n1 n2
Decimal: 27 92 n1 n2
Hexadecimal: 1B 5C n1 n2
Parameters
0≤n1≤255, 0≤n2≤255
Description
Specifies the horizontal print position (in dots) as a relative position from the current position.
A relative position specifies the next print position as a number of dots from the current position.
n1 and n2 indicate the number of dots from the current position. (Number of dots=n1+n2*256)
The dot spacing is calculated as 1/300 inch.
Left margin position≤horizontal position after moving<right margin position
Horizontal position after moving=n1+n2*256
The specified value for moving to the left is expressed as a two's complement. It is determined by the
following equation.
n1+n2*256=65536-distance actually moved
This command is available only with left alignment.
- 47 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC a n
Decimal: 27 97 n
Hexadecimal: 1B 61 n
Parameters
0≤n≤3 or “0”≤n≤“3”
Description
Prints the subsequent text with the alignment described below, according to the value of n.
n=0 or 48 (“0”): Applies left alignment.
n=1 or 49 (“1”): Applies center alignment.
n=2 or 50 (“2”): Applies right alignment.
n=3 or 51 (“3”): Applies nothing.
The default setting is n=0.
Data is aligned between the left and right margins by entering a CR, LF, and FF code or by buffer printing.
If the alignment setting is not at the beginning of the line, the alignment is specified after a line feed.
The beginning of the line indicates the left margin position for left alignment;
for right and center alignment, it means that no image or character is entered on the line.
HT, ESC \ and ESC $ are ignored when n=1 or n=2.
If the print media is continuous length tape, the printing orientation is landscape and the page length is not
specified, commands specifying alignment are ignored.
- 48 -
5. Control Command Details
ESC/P Command Reference
LF Line feed
ASCII: LF
Decimal: 10
Hexadecimal: 0A
Parameters
None
Description
Feeds the paper by the amount specified by a line feed command (ESC 0, ESC 2, ESC 3, ESC A).
The print position becomes the beginning of the next line.
The default value is a line feed of 48 dots.
A carriage return immediately after a line feed is ignored.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
Same process as CR
FF Page feed
ASCII: FF
Decimal: 12
Hexadecimal: 0C
Parameters
None
Description
Starts the printing.
The previously entered data string of characters and commands is cleared after being printed.
At this time, auto-canceling double-width characters specified with SO or ESC SO are canceled.
- 49 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC J n
Decimal: 27 74 n
Hexadecimal: 1B 4A n
Parameters
0≤n≤255
Description
Ends input for the current line and moves the vertical print position forward by n/300 inch (=1 dot).
If the bottom margin setting is exceeded, printing starts.
With left alignment, the print position for the next line becomes the end position of the current line.
(The horizontal position does not move to the left margin.)
With right alignment and center alignment, the horizontal position moves to the beginning of the line.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
- 50 -
5. Control Command Details
ESC/P Command Reference
Parameters
1≤n≤255
0≤k≤16
Description
The vertical tab position is the line feed amount (when this command was specified)*n from the top
margin.
Enter n values in ascending order and end the settings with NUL.
If an n value is smaller than a previous one, tab setting is ended.
Up to 16 vertical tabs can be specified.
ESC B NUL cancels all vertical tab positions.
Vertical tab positions can be specified regardless of the setting of the bottom margin position. However,
vertical tab positions outside the print area (beyond the bottom margin position) are invalid and only
become valid when a change in the top margin setting or bottom margin setting moves the print area to
include those tab positions.
Use VT to move to the vertical tab position.
When changing vertical tab positions, specify all positions again.
If the top margin is moved, the vertical tab positions are also moved by the same amount.
Even if the line feed amount is changed after the vertical tab positions have been specified, the vertical tab
position settings do not change.
Performing a VT when no vertical tabs have been specified is equal to performing a CR.
- 51 -
5. Control Command Details
ESC/P Command Reference
ASCII: VT
Decimal: 11
Hexadecimal: 0B
Parameters
None
Description
Moves the print position to the nearest vertical tab position down from the input position.
The next horizontal print position becomes the beginning of the line.
If the next vertical tab position extends beyond the bottom margin, or if there is no vertical tab position
specified below the current position, VT is performed as if it is (moves to the TOF position of the next
page).
ABCD
Line feed 21 EfghijkL
amount
3
VT code
4
5
6
Tab position
7 Abcdefg
8 VT code
9
10
11
Tab position
12 ABCDEFG
13 VT code
14
15
Tab position
16 aiueo
17
18
Example: Vertical tabs are specified at Lines 6, 11, and 15, and
data is entered while VT are performed.
When all vertical tab positions have been canceled by an initialization or with ESC B NUL, performing VT
is equal to performing CR.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
- 52 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC ( V nL nH mL mH
Decimal: 27 40 86 nL nH mL mH
Hexadecimal: 1B 28 56 nL nH mL mH
Parameters
nL=2
nH=0
0≤mL≤255
0≤mH≤127
Description
Specifies the vertical print position as an absolute position from the top margin position.
Vertical position=mL+mH*256+top margin
The absolute vertical position is measured from the top margin position when this command was specified.
If a position extending beyond the bottom margin is specified, printing starts.
There is no restriction on the amount of movement back (upward) from the current position.
With left alignment, the print position for the next line becomes the end position of the current line.
(The horizontal position does not move to the left margin.)
With right alignment and center alignment, the horizontal position moves to the beginning of the line.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
- 53 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC ( v nL nH mL mH
Decimal: 27 40 118 nL nH mL mH
Hexadecimal: 1B 28 76 nL nH mL mH
Parameters
nL=2
nH=0
0≤mL≤255
0≤mH≤127
-16384≤(mL+mH*256)≤16383
Description
Specifies the vertical print position* as a relative position from the current position.
Vertical position after movement=mL+mH*256+current position
When moving upwards, the specified value is expressed as a two's complement.
It is determined by the following equation.
mL+mH*256=65536–distance actually moved
Settings moving the print position above the top margin are ignored.
If a position extending beyond the bottom margin is specified, printing starts.
With left alignment, the print position for the next line becomes the end position of the current line.
(The horizontal position does not move to the left margin.)
With right alignment and center alignment, the horizontal position moves to the beginning of the line.
Auto-canceling double-width characters specified with SO or ESC SO are canceled.
* Print position : The print position is the standard position for printing characters, bitmaps, and barcodes.
- 54 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC ( c nL nH tL tH BL BH
Decimal: 27 40 99 nL nH tL tH BL BH
Hexadecimal: 1B 28 63 nL nH tL tH BL BH
Parameters
nL=4, nH=0
(tL+tH*256)<(BL+BH*256)
Top margin<bottom margin
Description
Specifies settings for the top and bottom margins.
The physically printable area depends on the media.
The top margin and the bottom margin are specified in units of 1/300 inch (=1 dot) using the top edge of
the physically printable area as the reference.
(The left margin and the right margin use the left edge of the physically printable area as the reference.)
Top margin=tL+tH*256
Bottom margin= BL+BH*256
The top margin position is the TOF in the vertical direction.
All previously entered text is cleared.
The character baseline for the first line of text is 24/300 inch (=24 dots) below the top margin.
When this command is used previously specified top and bottom margins are canceled.
A standard unit is not used.
If the print media is continuous length tape, the printing orientation is landscape and the page length is not
specified, commands specifying the page format are ignored.
If the minimum margin has been set to 3 mm and the printing orientation is landscape, both the top and
bottom margins increase by 1 mm.
- 55 -
5. Control Command Details
ESC/P Command Reference
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
0<(mL+mH*256)<12000
Description
Specifies the page length.
The unit is 1/300 inch (=1 dot).
Page length=mL+mH*256
The current paper position is the TOF.
The top and bottom margins 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.
Inch, mm, and dot conversion table
inch mm Number of dots
0 0.0 0
1 25.4 300
2 50.8 600
3 76.2 900
4 101.6 1200
5 127.0 1500
6 152.4 1800
7 177.8 2100
8 203.2 2400
9 228.6 2700
10 254.0 3000
11 279.4 3300
12 304.8 3600
13 330.2 3900
14 355.6 4200
15 381.0 4500
16 406.4 4800
17 431.8 5100
18 457.2 5400
19 482.6 5700
20 508.0 6000
- 56 -
5. Control Command Details
ESC/P Command Reference
ESC @ Initialize
ASCII: ESC @
Decimal: 27 64
Hexadecimal: 1B 40
Parameters
None
Description
Returns all commands to their default settings. (See below.)
Item Default Item Default
Proportional
Input buffer Saved Canceled*
pitch
International
Text buffer Cleared USA*
character set
Horizontal print
Bottom margin Depends on media Left margin position
position
Landscape
Right margin Depends on media Canceled*
setting
Vertical tab
None Font Brougham*
positions
Character
0 dot
spacing
* May differ depending on the user settings.
- 57 -
5. Control Command Details
ESC/P Command Reference
Parameters
m=0, 1, 2, 3, 4, 6, 32, 33, 38, 39, 40, 71, 72, 73
0≤n1≤255, 0≤n2≤11
The image data is as follows:
- n1+n2*256 bytes when m=0, 1, 2, 3, 4, 6
- (n1+n2*256)*3 bytes when m=32, 33, 38, 39, 40
- (n1+n2*256)*6 bytes when m=71, 72, 73
Description
Selects and outputs a bit image according to the value of m.
n1 and n2 indicate the number of dot positions.
n1: The remainder from dividing the number of dot positions by 256
n2: The quotient from dividing the number of dot positions by 256
- 58 -
5. Control Command Details
ESC/P Command Reference
When m=0, 1, 2, 3, 4, 6
n1 and n2 indicate the number of dot positions.
n1: The remainder from dividing the number of dot positions by 256
n2: The quotient from dividing the number of dot positions by 256
B7 B6 B5 B4 B3 B2 B1 B0
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
n1+n2*256 bytes
One dot of the image data is enlarged as follows, according to the value of m.
m=0 m =1 m =2 m =3 m =4 m =6
- 59 -
5. Control Command Details
ESC/P Command Reference
st nd rd
1 byte 2 byte 3 byte
B B B B B B B B B B B B B B B B B B B B B B B B
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
. . . . . . . . . .
.
.
.
.
.
.
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
(n1+n2*256)*3 bytes
- 60 -
5. Control Command Details
ESC/P Command Reference
One dot of the image data is enlarged as follows, according to the value of m.
- 61 -
5. Control Command Details
ESC/P Command Reference
. . . . . . . . . .
.
.
.
.
.
.
- 62 -
5. Control Command Details
ESC/P Command Reference
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB 1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
(n1+n2*256)*6 bytes
One dot of the image data is enlarged as follows, according to the value of m.
- 63 -
5. Control Command Details
ESC/P Command Reference
Parameters
0≤n1≤255, 0≤n2≤3
The data contains n1+n2*256 bytes of image data.
Description
Specifies that an 8-dot single-density bit image is printed with the number of dot positions indicated by n1 and
n2.
n1 and n2 indicate the number of dot positions.
n1: The remainder from dividing the number of dot positions by 256
n2: The quotient from dividing the number of dot positions by 256
B7 B6 B5 B4 B3 B2 B1 B0
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
n1+n2*256 bytes
- 64 -
5. Control Command Details
ESC/P Command Reference
Parameters
0≤n1≤255, 0≤n2≤3
The data contains n1+n2*256 bytes of image data.
Description
Specifies that an 8-dot double-density bit image is printed with the number of dot positions indicated by n1
and n2.
n1 and n2 are specified in the same way as with ESC K.
First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
n1+n2*256 bytes
- 65 -
5. Control Command Details
ESC/P Command Reference
Parameters
0≤n1≤255, 0≤n2≤3
The data contains n1+n2*256 bytes of image data.
Description
Same as for an 8-dot double-density bit image. Horizontally neighboring dots are not omitted.
Parameters
0≤n1≤255, 0≤n2≤7
The data contains n1+n2*256 bytes of image data.
Description
Specifies that an 8-dot quadruple-density bit image is printed with the number of dot positions indicated by n1
and n2.
n1 and n2 are specified in the same way as with ESC K.
Horizontally neighboring dots are not omitted.
First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
1byte
…
LSB
n1+n2*256 bytes
- 66 -
5. Control Command Details
ESC/P Command Reference
ESC i B Barcode
Parameters
(1) [Parameters]: Barcode parameters
T or t (type) t0: CODE39
t1: ITF (I-2/5)
t5: EAN-8, EAN-13, UPC-A
t6: UPC-E
t9: CODABAR
ta: CODE128
tb: GS1-128 (UCC/EAN-128)
tc: RSS symbols
td: CODE93
te: POSTNET
tf: UPC/EAN EXTENTION
tg: MSI
s (style) Ignored
R or r r0: OFF
(characters below barcode) r1: ON
- 67 -
5. Control Command Details
ESC/P Command Reference
h (height) h n1 n2
Height=n1+n2*256 (dots)
48≤height≤480
If height<48, height=48.
If height>480, height=480.
E or e e0: ON
(parentheses deletion) e1: OFF
z z0: (3:1)
(ratio between thick and z1: (2.5:1)
thin bars) z2: (2:1)
f f0: OFF
(equalize bar lengths) f1: ON
(A barcode with a large number of stacked rows may be considered out of specifications and
unreadable by the reader.)
- 68 -
5. Control Command Details
ESC/P Command Reference
Note
* For parameter numerals 0–9, both 00h–09h and 30h–39h are recognized.
* For parameter hexadecimals a–f, both 0ah–0gh and 61h–67h are recognized.
* The parameter types a, b, c, d, e, f and g are recognized even when uppercase.
* The parameter “parentheses deletion” is available only when GS1-128 (UCC/EAN-128) is selected.
* The parameter “ratio between thick and thin bars” is available only when t0, t1 or t9 is selected.
* The parameter “equalize bar lengths” is available only when t5 or t6 is selected.
* If any other type is selected, these parameters are ignored.
* When there is no type command or an invalid type command has been specified, CODE39 is
specified.
* The number of characters that can be entered for each barcode type is as follows:
t0: 1–50 characters (“*” is not included)
t1: 1–64 characters
t5: 7 characters (for EAN-8)
12 characters (for EAN-13)
11 characters (for UPC-A)
t6: 6 characters
t9: 3–64 characters (Must begin and end with A, B, C, or D.)
Lowercase letters “a”, “b”, “c” or “d” can be entered at the beginning or end, but the text that
will be printed are the uppercase letters “A”, “B”, “C” or “D”.
ta: 1–64 characters
tb: 1–64 characters
tc: 3–15 characters (begins with “01”) (except with RSS Expanded)
1
1–64 numbers or 1–40 letters* (for RSS Expanded)
1
* ISO646 characters can be printed.
(numbers, letters, spaces, !, ”, %, &, ’, (, ), *, +, ,, -, ., /, :, ;, <, =, >, ? and _)
td: 1–64 characters (The full set of ASCII characters can be used.)
te: 5 characters, 9 characters, 11 characters
tf: 2 characters, 5 characters
tg: 1–14 characters
- 69 -
5. Control Command Details
ESC/P Command Reference
CODE93, CODE128,
ESC i [Parameter] B or b [Barcode data] \\\
GS1-128 (UCC/EAN-128)
Description
Specifies a barcode image.
Any data extending beyond the right margin is ignored.
Since the check digit is generated automatically from the barcode data, the check digit is not sent as
barcode data. Since the length of the barcode data is also checked, the data would not be correctly
recognized if the check digit data was present.
With CODE39, ITF (I-2/5), CODABAR, CODE128, GS1-128 (UCC/EAN-128) or RSS Expanded, the buffer
length for the barcode image is about 22 cm. A barcode longer than 22 cm will not be printed.
The characters that can be printed with CODE128 and GS1-128 (UCC/EAN-128) are the 128 ASCII
characters and the special codes FNC1, FNC2, FNC3 and FNC4.
Codes assigned to the special codes:
The control codes and special codes appear as spaces when characters are printed below CODE128 and
GS1-128 (UCC/EAN-128) barcodes.
The control codes appear as spaces when characters are printed below CODE93 barcodes.
Special code FNC1 can also be printed with RSS Expanded.
This special code also appears as a space when characters are printed below the barcode.
Code assigned to the special code:
FNC1: 86h
The width can be set to extra extra small only with CODE128 and EAN128.
Characters are not printed below the barcode when the width is set to extra extra small.
Example
For barcode type CODE39, with no characters printed below the barcode, a size of large (width) × 480 dots
(height) and a ratio between thick and thin bars of 3:1, the command will be as shown below.
ESC i t0 r0 he0h 01h w3 z0 B 123456789 \
- 70 -
5. Control Command Details
ESC/P Command Reference
Parameters
(1) [Parameters]
Unlike with 1D barcodes, all parameters must be specified in order, starting from the top.
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
1. Cell size Specifies the dot size per cell side.
[1-byte decimal] 3 Prints 3 dots per cell side. (default value)
[1-byte decimal] 4 Prints 4 dots per cell side.
[1-byte decimal] 5 Prints 5 dots per cell side.
[1-byte decimal] 6 Prints 6 dots per cell side.
[1-byte decimal] 8 Prints 8 dots per cell side.
[1-byte decimal] 10 Prints 10 dots per cell side.
4. Code [1-byte decimal] 1–16 Indicates the number of the symbol in a partitioned QR
number Code.
5. Number of [1-byte decimal] 2–16 Indicates the total number of symbols in a partitioned QR
partitions Code.
6. Parity data [1-byte hexadecimal] Value (in bytes) of exclusively OR’ing all the print data
00-FF (print data before partition)
- 71 -
5. Control Command Details
ESC/P Command Reference
(*1) With Micro QR, the Structured Append setting is invalid, and the default setting is used.
(*2) With Micro QR, error correction level 4 is invalid, and the default setting is used.
XOR of 31h and 32h 0011 0001 ^= 0011 0010 0000 0011 (03h)
XOR of 03h and 33h 0000 0011 ^= 0011 0011 0011 0000 (30h)
Note
If this parity value is incorrect, the correct QR Code is not generated.
- 72 -
5. Control Command Details
ESC/P Command Reference
Summary
Printing the character string “123456789” with a cell size of 4 dots, Model 2, standard error correction level,
and automatic data input.
Without Structured ESC i Q 04h 02h 00h 00h 00h 00h 02h 00h “123456789” \\\
Append
With Structured ESC i Q 04h 02h 01h 01h 03h 31h 02h 00h “123” \\\
Append ESC i Q 04h 02h 01h 02h 03h 31h 02h 00h “456” \\\
[Three partitions] ESC i Q 04h 02h 01h 03h 03h 31h 02h 00h “789” \\\
(The parity for the character string “123456789” is 31h.)
Alphanumeric
A or a ESC i Q [other parameters] 01h A012345678aBcDe \\\
character input
Kanji character
K or k ESC i Q [other parameters] 01h K kanji character input \\\
input
The number of barcode data characters that can be entered depends on the model type and the input
method.
Model 1 707 English alphanumeric characters, 1167 numbers, 486 binary bytes, 299
kanji characters
Model 2 4296 English alphanumeric characters, 7089 numbers, 2953 binary bytes, 1817
kanji characters
- 73 -
5. Control Command Details
ESC/P Command Reference
Example
Refer to the section “Summary”.
ASCII: ESC i P n
Decimal: 27 105 80 n
Hexadecimal: 1B 69 50 n
Parameters
0≤n≤40
Description
The barcode size can be fixed.
The default value is 0.
The available versions differ depending on the symbol type used.
If a setting other than those listed is specified, the setting returns to its default.
The following settings are available for each symbol type.
Model1 (0–14), Model2 (0–40), MicroQR (0–4)
- 74 -
5. Control Command Details
ESC/P Command Reference
Parameters
(1) [Parameters]
Unlike with 1D barcodes, all parameters must be specified in order, starting from the top.
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
1. Cell size Specifies the dot size per cell side.
[1-byte decimal] 3 Prints 3 dots per cell side. (default value)
[1-byte decimal] 4 Prints 4 dots per cell side.
[1-byte decimal] 5 Prints 5 dots per cell side.
[1-byte decimal] 6 Prints 6 dots per cell side.
[1-byte decimal] 8 Prints 8 dots per cell side.
[1-byte decimal] 10 Prints 10 dots per cell side.
- 75 -
5. Control Command Details
ESC/P Command Reference
Auto Auto
1 Auto 11 14 17 20 24 28
2 Auto 8 11 14 17 20 23 26
3 Auto 6 8 10 12 15 20 26 32 38 44
4 Auto 4 6 8 10 12 15 20 26 32 38 44
- 76 -
5. Control Command Details
ESC/P Command Reference
- 77 -
5. Control Command Details
ESC/P Command Reference
Parameters
(1) [Parameters]
Unlike with 1D barcodes, all parameters must be specified in order, starting from the top.
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
1. Cell size Specifies the dot size per cell side.
[1-byte decimal] 3 Prints 3 dots per cell side. (default value)
[1-byte decimal] 4 Prints 4 dots per cell side.
[1-byte decimal] 5 Prints 5 dots per cell side.
[1-byte decimal] 6 Prints 6 dots per cell side.
[1-byte decimal] 8 Prints 8 dots per cell side.
[1-byte decimal] 10 Prints 10 dots per cell side.
- 78 -
5. Control Command Details
ESC/P Command Reference
[ECC200 rectangular]
[1-byte decimal] 0 Vertical no. of cells: AUTO (default value)
[1-byte decimal] 8 Vertical no. of cells: 8 cells
[1-byte decimal] 12 Vertical no. of cells: 12 cells
[1-byte decimal] 16 Vertical no. of cells: 16 cells
[ECC200 rectangular]
(1) When the vertical size is AUTO
[1-byte decimal] 0 Horizontal no. of cells: AUTO (default value)
Note
* If the vertical size is specified as a value other than those listed for ECC200 square, the AUTO
setting is selected. If the horizontal size is specified as a value different from the vertical size, the
setting is changed to the same value as the horizontal size.
* If the vertical or horizontal size for ECC200 rectangular is specified as a value other than those
listed, the AUTO setting is selected.
- 79 -
5. Control Command Details
ESC/P Command Reference
Example
For data “12345” with symbol type ECC square at 40 × 40 with a 3-dot cell size, the command will be as
shown below.
ESC i D 03h 00h 28h(40d) 28h 00h 00h 00h 00h 00h “12345” \\\
- 80 -
5. Control Command Details
ESC/P Command Reference
Parameters
(1) [Parameters]
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
1. Symbol
type [1-byte decimal] 0 Standard (default value)
[1-byte decimal] 1 Full EEC
[1-byte decimal] 2 Structured carrier message
(2) \ (backslash)
Separator between parameters and barcode data
Standard 93 138
Note
The numbers of characters that can be entered (as listed above) are for when using only the
common character set (code set A in the MaxiCode specifications). The number of characters that
can be entered may decrease, depending on the characters that are used.
- 81 -
5. Control Command Details
ESC/P Command Reference
When the symbol type is the structured carrier message, the service class, country code and postal
code can be specified separately from the normal data. Specify each value, separated by a backslash
and comma (\,), immediately before the normal data.
<postal_code>\,<country_code>\,<service_class>\,<normal_barcode_data>
When “\,” is not used three times, the data is written as shown in the following example.
<data1>\,<data2>\,<normal_barcode_data>
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
Postal code 9 or less numbers, or Ignored when not structured carrier message.
6 or less alphanumeric characters Default value: 000000000
Country code 3 or less numbers Ignored when not structured carrier message.
Default value: 000
Service class 3 or less numbers Ignored when not structured carrier message.
Default value: 000
Note
If the postal code is specified as alphanumeric characters, characters other than those listed
below are invalid.
A to Z “ # $ % & ‘ ( ) * + , - . / 0 to 9 :
However, lowercase letters (a to z) are converted to the valid uppercase letters (A to Z).
- 82 -
5. Control Command Details
ESC/P Command Reference
Parameters
(1) [Parameters]
If a value other than those listed is entered for a parameter, that parameter is specified with its default
value.
1. Cell size Specifies the dot size per cell side.
[1-byte decimal] 1 Prints 1 dot per cell side.
[1-byte decimal] 2 Prints 2 dots per cell side.
[1-byte decimal] 3 Prints 3 dots per cell side. (default value)
[1-byte decimal] 4 Prints 4 dots per cell side.
[1-byte decimal] 5 Prints 5 dots per cell side.
[1-byte decimal] 6 Prints 6 dots per cell side.
[1-byte decimal] 8 Prints 8 dots per cell side.
[1-byte decimal] 10 Prints 10 dots per cell side.
3. Error
correction [1-byte decimal] 1–99 [Percentage (default value is 23)
capacity
[Compact]
[1-byte decimal] 0 Auto setting (default value)
[1-byte decimal] 1–4 Manual settings
Note: Symbol size is fixed as AUTO when Symbol type is specified as AUTO.
6. Number of [1-byte decimal] 2–26 Partitioned Only valid when the number of blocks is
blocks specified (Default it 2)
- 83 -
5. Control Command Details
ESC/P Command Reference
- 84 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i F P n
Decimal: 27 105 70 80 n
Hexadecimal: 1B 69 46 50 n
Parameters
n: file header index
0≤n≤98
Description
Expands downloaded data in the print buffer as image data.
Expands downloaded image data from the print position.
If there is no image data, this command is ignored.
Must be
downloaded
beforehand
Image file
(.bmp)
This printer PC
Abcdefg
ABCDEFG
HIJK
- 85 -
5. Control Command Details
ESC/P Command Reference
As with text, if the image data does not all fit on the current line, an automatic line feed is performed, and
the data is placed at the beginning of the next line. At that time, the any data that does not fit in the print
area is deleted.
1. The text is entered. 2. The downloaded image 3. Since the image does
is entered. not fit, it is pasted in
after an automatic line
feed.
Example: Normal size
Abc
Abc Abc
1. The text is entered. 2. The downloaded image 3. Since the image does not fit,
is entered. it is pasted in after an
automatic line feed and
trimmed to fit between the
left and right margins.
Example: Image larger than the distance between left and right margins
- 86 -
5. Control Command Details
ESC/P Command Reference
If the result of pasting in the downloaded image extends beyond the bottom margin position, the image is
pasted in after a page feed. However, if the downloaded image is larger than the entire area between the
top and bottom margins, the entire image is ignored.
WLMBGOr WLMBGOr
Dabfdifpdzra Dabfdifpdzra
BGHJgmfg BGHJgmfg
gfdslrt gfdslrt
1. The text is entered. 2. The downloaded image 3. Since the image does not
is entered. fit, it is pasted in after an
automatic page feed.
Example: Image smaller than the distance between the top and bottom margins
Example: Image larger than the distance between top and bottom margins
- 87 -
5. Control Command Details
ESC/P Command Reference
There are limits on the amount of image data that can be stored in the printer. The size of the storage area
is 6,144 KB. However, bitmap data is not stored as is, but is converted into the printer storage format by
Transfer Manager.
Image data larger than the media size is handled by deleting the portion of the image that does not fit
within the size of the media.
The portion of image data deleted depends on the media orientation.
Examples
Portrait (Media: Die-cut shipping label)
Size of Downloaded Image Print Size
Portion used
Portion used
- 88 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i a n
Decimal: 27 105 97 n
Hexadecimal: 1B 69 61 n
Parameters
n: Command mode
0 or 48: ESC/P standard mode
1 or 49: Raster graphics mode
3 or 51: P-touch Template mode
Description
Switches the command mode to ESC/P, P-touch Template or PTCBP (raster graphics) mode.
Dynamically switches between the three modes.
Since this is a dynamic command, after the printer is turned off and on again, the setting returns to the
previously setting.
- 89 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i S
Decimal: 27 105 83
Hexadecimal: 1B 69 53
Parameters
None
Description
Sends a requests for the printer status.
The printer status consists of 32 bytes.
- 90 -
5. Control Command Details
ESC/P Command Reference
- 91 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i L n
Decimal: 27 105 76 n
Hexadecimal: 1B 69 4C n
Parameters
n=0, 1 or 48, 49
Description
Applies or cancels the landscape orientation
n=1 or 49 (“1”): Applies the landscape orientation.
n=0 or 48 (“0”): Cancels the landscape orientation.
Using this command clears all text.
Before entering text, specify the paper orientation with this command.
When the printer is turned on, the landscape orientation is canceled.
ABC
ABC
- 92 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i C n
Decimal: 27 105 67 n
Hexadecimal: 1B 69 43 n
Parameters
n=0, 1 or 48, 49
Description
Specifies cutting after printing.
n=1 or 49 (“1”): Specifies cutting.
n=0 or 48 (“0”): Cancels cutting.
The default auto cut setting can be changed with the P-touch Template Settings Tool
(P-touch Template Settings.exe).
The number of auto cut copies can be specified with the P-touch Template Settings Tool
(P-touch Template Settings.exe).
Manufacturer’s default auto cut setting: ON (auto cut)
Manufacturer’s default auto cut copies: 1
- 93 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X Q 2 n1 n2 n3
Decimal: 27 105 88 81 50 n1 n2 n3
Hexadecimal: 1B 69 58 51 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
00h≤n3≤04h
Description
Selects the default character style.
n3=00h: None (normal characters) (*Manufacturer’s default)
n3=01h: Bold
n3=02h: Outline
n3=03h: Shadow
n3=04h: Shadow and outline
This command is a static command.
Remarks
Invalid if n3 is a value other than 00h through 04h
- 94 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X Q 1 n1 n2
Decimal: 27 105 88 81 49 n1 n2
Hexadecimal: 1B 69 58 51 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default character style setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: None (normal characters)
01h: Bold
02h: Outline
03h: Shadow
04h: Shadow and outline
The retrieved value is a value specified by a static command.
- 95 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X k 2 n1 n2 n3
Decimal: 27 105 88 107 50 n1 n2 n3
Hexadecimal: 1B 69 58 6B 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
00h≤n3≤04h, 09h≤n3≤0Bh
Description
Selects the default font.
n3=00h: Brougham (bitmap) (Manufacturer’s default)
n3=01h: Letter Gothic Bold (bitmap)
n3=02h: Brussels (bitmap)
n3=03h: Helsinki (bitmap)
n3=04h: San Diego (bitmap)
n3=09h: Letter Gothic (outline)
n3=0Ah: Brussels (outline)
n3=0Bh: Helsinki (outline)
This command is a static command.
Remarks
Invalid if n3 is a value outside of the allowable range
- 96 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X k 1 n1 n2
Decimal: 27 105 88 107 49 n1 n2
Hexadecimal: 1B 69 58 6B 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default font setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: Brougham (bitmap) (Manufacturer’s default)
01h: Letter Gothic Bold (bitmap)
02h: Brussels (bitmap)
03h: Helsinki (bitmap)
04h: San Diego (bitmap)
09h: Letter Gothic (outline)
0Ah: Brussels (outline)
0Bh: Helsinki (outline)
The retrieved value is a value specified by a static command.
- 97 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X X 2 n1 n2 n3 n4
Decimal: 27 105 88 88 50 n1 n2 n3 n4
Hexadecimal: 1B 69 58 58 32 n1 n2 n3 n4
Parameters
n1: 02h (Fixed)
n2: 00h (Fixed)
00h≤n3≤FFh, 00h≤n4≤01h
Description
Specifies the default character size.
n3+(n4*256): Default character size (dots)
The following settings (dots) are valid.
24, 32, 33, 38, 42, 46, 48, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200, 233, 267, 300, 333, 367,
400
The manufacturer’s default is 32.
This command is a static command.
Remarks
Invalid if the setting is a value outside of the allowable range
- 98 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X X 1 n1 n2
Decimal: 27 105 88 88 49 n1 n2
Hexadecimal: 1B 69 58 58 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default character size setting is returned as 4-byte data.
[1] 02h (Fixed)
[2] 00h (Fixed)
[3, 4] n3 n4 settings
n3+(n4*256): Default character size (dots)
The retrieved value is a value specified by a static command.
ASCII: ESC i X 3 2 n1 n2 n3 n4
Decimal: 27 105 88 51 50 n1 n2 n3 n4
Hexadecimal: 1B 69 58 33 32 n1 n2 n3 n4
Parameters
n1: 02h (Fixed)
n2: 00h (Fixed)
00h≤n3≤FFh, 00h≤n4≤04h
Description
Specifies the default line feed.
n3+(n4*256): Default line feed (dots) (0 through 1275)
*The manufacturer’s default is 48.
This command is a static command.
Remarks
Invalid if the setting is a value outside of the allowable range
- 99 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X 3 1 n1 n2
Decimal: 27 105 88 51 49 n1 n2
Hexadecimal: 1B 69 58 33 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default line feed setting is returned as 4-byte data.
[1] 02h (Fixed)
[2] 00h (Fixed)
[3, 4] n3 n4 settings
n3+(n4*256): Default line feed (dots)
The retrieved value is a value specified by a static command.
ASCII: ESC i X A 2 n1 n2 n3
Decimal: 27 105 88 65 50 n1 n2 n3
Hexadecimal: 1B 69 58 41 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
00h≤n3≤02h
Description
Selects the default alignment.
n3=00h: Left alignment (Manufacturer’s default)
n3=01h: Center alignment
n3=02h: Right alignment
This command is a static command.
Remarks
Invalid if n3 is a value outside of the allowable range
If the print media is continuous length tape, the printing orientation is landscape and the page length is not
specified, commands specifying the alignment are ignored.
- 100 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X A 1 n1 n2
Decimal: 27 105 88 65 49 n1 n2
Hexadecimal: 1B 69 58 41 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default alignment setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: Left alignment
01h: Center alignment
02h: Right alignment
The retrieved value is a value specified by a static command.
- 101 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X ( 2 n1 n2 n3 n4
Decimal: 27 105 88 40 50 n1 n2 n3 n4
Hexadecimal: 1B 69 58 28 32 n1 n2 n3 n4
Parameters
n1: 02h (Fixed)
n2: 00h (Fixed)
00h≤n3≤FFh, 00h≤n4≤2Eh
Description
Specifies the default page length.
n3+(n4*256): Default page length (dots) (0, 80 through 11999)
*A default page length of 0 indicates the Auto setting.
*The manufacturer’s default is 0.
This command is a static command.
Remarks
Invalid if the setting is a value outside of the allowable range
ASCII: ESC i X ( 1 n1 n2
Decimal: 27 105 88 40 49 n1 n2
Hexadecimal: 1B 69 58 28 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default page length setting is returned as 4-byte data.
[1] 02h (Fixed)
[2] 00h (Fixed)
[3, 4] n3 n4 settings
n3+(n4*256): Default page length (dots)
*A default page length of 0 indicates the Auto setting.
The retrieved value is a value specified by a static command.
- 102 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X L 2 n1 n2 n3
Decimal: 27 105 88 76 50 n1 n2 n3
Hexadecimal: 1B 69 58 4C 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
00h≤n3≤01h
Description
Selects the default landscape orientation setting.
n3=00h: Cancel landscape orientation (*Manufacturer’s default)
n3=01h: Apply landscape orientation
This command is a static command.
Remarks
Invalid if n3 is a value outside of the allowable range
ASCII: ESC i X L 1 n1 n2
Decimal: 27 105 88 76 49 n1 n2
Hexadecimal: 1B 69 58 4C 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default landscape orientation setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: Cancel landscape orientation
01h: Apply landscape orientation
The retrieved value is a value specified by a static command.
- 103 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X j 2 n1 n2 n3
Decimal: 27 105 88 106 50 n1 n2 n3
Hexadecimal: 1B 69 58 6A 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
00h≤n3≤0Dh, 40h
Description
Selects the default international character set.
n3=00h: U.S.A. (*Manufacturer’s default)
n3=01h: France
n3=02h: Germany
n3=03h: U.K.
n3=04h: Denmark I
n3=05h: Sweden
n3=06h: Italy
n3=07h: Spain I
n3=08h: Japan
n3=09h: Norway
n3=0Ah: Denmark II
n3=0Bh: Spain II
n3=0Ch: Latin America
n3=0Dh: South Korea
n3=40h: Legal
This command is a static command.
Remarks
Invalid if n3 is a value outside of the allowable range
- 104 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X j 1 n1 n2
Decimal: 27 105 88 106 49 n1 n2
Hexadecimal: 1B 69 58 6A 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default international character set setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: U.S.A.
01h: France
02h: Germany
03h: U.K.
04h: Denmark I
05h: Sweden
06h: Italy
07h: Spain I
08h: Japan
09h: Norway
0Ah: Denmark II
0Bh: Spain II
0Ch: Latin America
0Dh: South Korea
40h: Legal
The retrieved value is a value specified by a static command.
- 105 -
5. Control Command Details
ESC/P Command Reference
ASCII: ESC i X m 2 n1 n2 n3
Decimal: 27 105 88 109 50 n1 n2 n3
Hexadecimal: 1B 69 58 6D 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
n3: 00h, 01h, 02h
Description
Selects the default character code set.
n3=00h: Standard character code set
n3=01h: Eastern European character code set
n3=02h: Western European character code set (Manufacturer’s default)
This command is a static command.
Remarks
Invalid if n3 is a value outside of the allowable range
ASCII: ESC i X m 1 n1 n2
Decimal: 27 105 88 109 49 n1 n2
Hexadecimal: 1B 69 58 6D 31 n1 n2
Parameters
n1: 00h (Fixed)
n2: 00h (Fixed)
Description
The default character code set setting is returned as 3-byte data.
[1] 01h (Fixed)
[2] 00h (Fixed)
[3] Setting
00h: Standard character code set
01h: Eastern European character code set
02h: Western European character code set
The retrieved value is a value specified by a static command.
- 106 -
5. Control Command Details
ESC/P Command Reference
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 SP 0 @ P ` p € ° À Ð à ð
1 ! 1 A Q a q ~ ‘ ¡ ± Á Ñ á ñ
2 ” 2 B R b r , ’ ¢ ² Â Ò â ò
3 # 3 C S c s ƒ “ £ ³ Ã Ó ã ó
4 $ 4 D T d t „ ” ¤ ´ Ä Ô ä ô
5 % 5 E U e u … • ¥ µ Å Õ å õ
6 & 6 F V f v † - | ¶ Æ Ö æ ö
7 ’ 7 G W g w ‡ — § · Ç × ç ÷
8 ( 8 H X h x ˆ ˜ ¨ ¸ È Ø è ø
9 ) 9 I Y i y ‰ © ¹ É Ù é ù
a o
A * : J Z j z Š š ¯ ¯ Ê Ú ê ú
B + ; K [ k { < > « » Ë Û ë û
C , < L \ l ¦ Œ œ ¬ ¼ Ì Ü ì ü
D - = M ] m } ½ Í Ý í ý
E . > N ^ n ˜ Ž ž ® ¾ Î Þ î þ
F / ? O _ o DEL Ÿ ¯ ¿ Ï ß ï ÿ
Note
" " indicates that a space is printed.
" " indicates that the character will switch when the international character set is changed.
- 107 -
Appendix A: Character Code Tables
ESC/P Command Reference
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 SP 0 @ P ` p € tˇ ° Ŕ Đ ŕ đ
1 ! 1 A Q a q À ‘ ˇ ± Á Ń á ń
2 " 2 B R b r , ’ ˘ ˛ Â Ň â ň
3 # 3 C S c s ˇ “ Ł ł Ă Ó ă ó
L
4 $ 4 D T d t „ ” ¤ ´ Ä Ô ä ô
5 % 5 E U e u … • Ą µ Ĺ Ő ĺ ő
6 & 6 F V f v † – | ¶ Ć Ö ć ö
7 ’ 7 G W g w ‡ — § · Ç × ç ÷
8 ( 8 H X h x ľ ¨ ¸ Č Ř č ř
9 ) 9 I Y i y ‰ ™ © ą É Ů é ů
A * : J Z j z Š š Ş ş Ę Ú ę ú
B + ; K [ k { < > « » Ë Ű ë ű
C , < L \ l ¦ Ś ś ¬ Ľ Ě Ü ě ü
D – = M ] m } Ť ť – ˝ Í Ý í ý
E . > N ^ n ˜ Ž ž ® ľ Î Ţ î ţ
F / ? O _ o DEL Ź ź Ż ż Ď ß ď ˙
Note
" " indicates that a space is printed.
" " indicates that the character will switch when the international character set is changed.
- 108 -
Appendix A: Character Code Tables
ESC/P Command Reference
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 SP 0 @ P ` p Ç É á ░ └ α
1 ! 1 A Q a q ü æ í ▒ ┴ β ±
2 ” 2 B R b r é Æ ó ▓ ┬
3 # 3 C S c s â ô ú │ ├ ¾
4 $ 4 D T d t ä ö ñ ┤ ─
5 % 5 E U e u à ò Ñ ┼ §
a
6 & 6 F V f v å û ¯ µ ÷
o
7 ’ 7 G W g w ç ù ¯
8 ( 8 H X h x ê ÿ ¿ © ╚ °
9 ) 9 I Y i y ë Ö ® ╣ ╔ ┘ ·
A * : J Z j z è Ü € ║ ╩ ┌ Ω
B + ; K [ k { ï ¢ ½ ╗ ╦ δ
C , < L \ l ¦ î £ ¼ ╝ ╠ ³
D - = M ] m } ì ¥ ¡ TEL ═ ø ²
F / ? O _ o DEL Å ƒ » ┐
Note
" " indicates that a space is printed.
" " indicates that the character will switch when the international character set is changed.
- 109 -
Appendix A: Character Code Tables
ESC/P Command Reference
Corresponding characters that switch in each language when the international character set is changed
n 23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E
0 United States (U.S.A) # $ @ [ \ ] ^ ` { ¦ } ˜
1 France # $ à ° ç § ^ ` é ù è ¨
2 Germany # $ § Ä Ö Ü ^ ` ä ö ü ß
3 Britain (U.K.) £ $ @ [ \ ] ^ ` { ¦ } ˜
4 Denmark I # $ @ Æ Ø Å ^ ` æ ø å ˜
5 Sweden # ¤ É Ä Ö Å Ü é ä ö å ü
6 Italy # $ @ ° \ é ^ ù à ò è ì
7 Spain I Pt $ @ ¡ Ñ ¿ ^ ` ¨ ñ } ˜
8 Japan # $ @ [ ¥ ] ^ ` { ¦ } ˜
9 Norway # ¤ É Æ Ø Å Ü é æ ø å ü
10 Denmark II # $ É Æ Ø Å Ü é æ ø å ü
11 Spain II # $ á ¡ Ñ ¿ é ` í ñ ó ú
12 Latin America # $ á ¡ Ñ ¿ é ü í ñ ó ú
13 South Korea # $ @ [ W ] ^ ` { ¦ } ˜
64 Legal # $ § ° ´ " ¶ ` © ® † TM
- 110 -
Appendix A: Character Code Tables
ESC/P Command Reference
- 111 -
Appendix B: Introducing the Brother Developer Center