Brother PJ-722, PJ-723, PJ-762, PJ-763, PJ-763MFi Software Developer's Manual ESC/P Legacy Command Reference Version 1.00

...
Software Developer's Manual
ESC/P Legacy Command Reference
PJ-722/723/762/763/763MFi/773
Version 1.00
The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2015 Brother Industries, Ltd. All rights reserved.

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
3. ESC/P Legacy Command Limitations·················································· 1
3.1 Print area ............................................................................................................... 1
3.2 Characters ............................................................................................................. 3
3.3 Resolution ............................................................................................................. 3
4. Control Code List ············································································ 4
5. Control Command Details ································································· 7
5.1 Paper feed commands .......................................................................................... 7
CR Carriage return ................................................................................ 7
FF Form feed ........................................................................................ 7
LF Line feed .......................................................................................... 8
ESC 0 Specify line feed of 1/8 inch ............................................................. 8
ESC 2 Specify line feed of 1/6 inch ............................................................. 9
ESC 3 Specify line feed of n/180 inch ......................................................... 9
ESC A Specify line feed of n/60 inch ......................................................... 10
ESC + Specify line feed of n/360 inch ....................................................... 10
ESC J Specify forward paper feed of n/180 inch ....................................... 10
5.2 Print area setting commands ............................................................................... 11
ESC C Specify page length in lines ........................................................... 11
ESC C 0 Specify page length in inches ........................................................ 11
ESC N Specify skip perforation.................................................................. 12
ESC O Cancel skip perforation .................................................................. 12
5.3 Tab setting commands ......................................................................................... 13
ESC B Specify vertical tab position ........................................................... 13
VT Perform vertical tab ........................................................................ 13
ESC D Specify horizontal tab position ....................................................... 14
HT Perform horizontal tab ................................................................... 14
5.4 Print position setting commands .......................................................................... 15
ESC l Specify left margin ......................................................................... 15
ESC Q Specify right margin ....................................................................... 16
BS Backspace ..................................................................................... 17
ESC $ Specify absolute position ............................................................... 17
ESC \ Specify relative position ................................................................. 18
5.5 Character selection commands ........................................................................... 19
ESC k Select font ...................................................................................... 19
ESC P Specify 10 cpi ................................................................................ 19
ESC M Specify 12 cpi ................................................................................ 19
ESC g Specify 15 cpi ................................................................................ 20
ESC p Apply/cancel proportional characters ............................................. 20
ESC S Apply superscript/subscript ............................................................ 21
ESC T Cancel superscript/subscript .......................................................... 21
ESC t Select character code table ........................................................... 22
ESC R Select international character set .................................................. 23
5.6 Character style commands .................................................................................. 24
ESC x Select text quality .......................................................................... 24
SI, ESC SI Specify reduced characters ........................................................... 24
DC2 Cancel reduced characters ............................................................ 25
SO, ESC SO Specify auto-canceling double-width characters .......................... 25
DC4 Cancel auto-canceling double-width characters ............................ 25
- i ­Introduction
ESC/P Legacy Command Reference
ESC W Specify/cancel double-width characters ......................................... 26
ESC w Specify/cancel double-height characters ....................................... 26
ESC E Apply bold style ............................................................................. 27
ESC F Cancel bold style ........................................................................... 27
ESC G Apply double-strike printing ........................................................... 28
ESC H Cancel double-strike printing ......................................................... 28
ESC – Apply/cancel underlining ................................................................ 29
ESC SP Specify character spacing .............................................................. 29
ESC q Select character style .................................................................... 30
ESC 4 Apply italic ..................................................................................... 30
ESC 5 Cancel italic ................................................................................... 30
ESC ! Global formatting ........................................................................... 31
5.7 Character definition commands ........................................................................... 32
ESC & 0 Define download characters .......................................................... 32
ESC % Apply/cancel download character set ............................................ 32
ESC : 0 Copy character set......................................................................... 33
ESC 6 Cancel upper control codes ........................................................... 33
ESC 7 Apply upper control codes ............................................................. 33
5.8 Supplemental function commands....................................................................... 34
ESC @ Initialize .......................................................................................... 34
5.9 Others .................................................................................................................. 35
ESC K 8-bit single-density bit image ......................................................... 35
ESC L 8-bit double-density bit image ........................................................ 35
ESC Y 8-bit double-speed double-density bit image ................................. 36
ESC Z 8-bit quadruple-density bit image ................................................... 37
ESC * Select bit image ............................................................................. 37
ESC ? Convert bit image ......................................................................... 38
ESC / Select VFU channel ....................................................................... 38
ESC b Specify VFU tab position ................................................................ 39
5.10 Advanced commands ........................................................................................ 40
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
Loading...
+ 41 hidden pages