Epson ESC/P Language Reference

Epson Command Topics (Through N9 ROM)

Printer Control Print Size and Character Width
MSB Control Print Enhancement
Data Control Word Processing
Vertical Motion Character Tables
Horizontal Motion User Defined Characters
Overall Printing Style Graphics
ESC/P2 Commands

Printer Control

Command Description
Esc @ Initialize printer.
Ctrl+Q Select printer.
Ctrl+S Deselect printer.
Dec(127) Delete Character.
Esc < Select Unidirectionalunidir mode.
Esc U (n) Turn Unidirectionalunidir mode ON(n=Ctrl+A)/OFF (n=Ctrl+@).
Esc Ctrl+Y (n) Control cut sheet feeder.

n values:

Ctrl+@: Turns mode off

Ctrl+A: Selects bin 1

Ctrl+B: Selects bin 2

Ctrl+D: Turns mode on

R: Ejects a sheet

MSB Control (Most Significant Bit)

Command Description
Esc = Set MSB to 0.
Esc > Set MSB to 1.
Esc # Cancel MSB control.
Ctrl+G Beeper.

Data Control

Command Description
Ctrl+M Carriage Return.
Ctrl+X Cancel

Vertical Motion

Command Description
Ctrl+L Form Feedformfeed.
Esc C (n) Set page length in n lines.
Esc C Ctrl+@ (n) Set page length in n inches.
Esc N (n) Set skip over Perforation
Esc O Cancel skip over Perforation.
Ctrl+J Line Feed.
Esc + (n) Set n/360-inch line spacing.
Esc 0 Select 1/8-inch line spacing.
Esc 2 Select 1/6-inch line spacing.
Esc 3 Set n/180-inch line spacing.
Esc A Set n/60-inch line spacing.
Esc J Perform n/180-inch Line Feed.
Ctrl+K Tab vertically.
Esc B (n1) (n2) ... Ctrl+@ Set vertical tabs at n1, n2 positions. Esc B Ctrl+@ clears all tabs.
Esc b (c) (n1) (n2) ... Ctrl+@ Set vertical tabs in channels. c=channel atn1, n2 positions. Esc b (c) Ctrl+@ clearstabs in channel c.
Esc / (c) Select vertical Tab channel. Set Tab channelto c.

Horizontal Motion

Command Description
Esc 1 (n) Set left Margin (n columns in current Character size.)
Esc Q (n) Set right Margin (n columns in current Character size.)
Ctrl+H Backspace.
Esc $ (n1) (n2) Set absolute print position.
Esc \ (n1) (n2) Set relative print position.
Ctrl+I Tab horizontally.
Esc D (n1) (n2) ... Ctrl+@ Set horizontal tabs at n1, n2 positions.

Esc D Ctrl+@ clears all tabs.

Overall Printing Style

Command Description
Esc x (n) Select Letter Qualitylq (n=1) or draft (n=0).
Esc k (n) Select Typestyle Family.

n values:

Ctrl+@: Roman

Ctrl+A: Sans Serif

Ctrl+B: Couriercourier

Ctrl+C: Prestige

Ctrl+D: Scriptscript

Ctrl+E: OCR-B

Ctrl+F: OCR-A

Ctrl+G: Orator

Ctrl+H: Orator-S

Ctrl+I: Scriptscript C

Esc ! Master Select.

Print Size and Character Width

Command Description
Esc P Select 10 CPIcpi.
Esc M Select 12 CPIcpi.
Esc g Select 15 CPIcpi.
Esc p (n) Turn proportional mode ON(n=Ctrl+A)/OFF(n=Ctrl+@).
Ctrl+O Select Condensedcompressed mode.
Esc Ctrl+O Select Condensedcompressed mode.
Ctrl+R Cancel Condensedcompressed mode.
Ctrl+N Select double-wide mode (one line).
Esc Ctrl+N Select double-wide mode (one line).
Esc W (n) Turn double-wide mode ON(n=Ctrl+A)/OFF(n=Ctrl+@).
Ctrl+T Cancel double-wide mode.
Esc w (n) Turn double-high mode ON(n=Ctrl+A)OFF(n=Ctrl+@)

Print Enhancement

Command Description
Esc E Select emphasized mode.
Esc F Cancel emphasized mode.
Esc G Select double-strike mode.
Esc H Cancel double-strike mode.
Esc S Ctrl+@ Select Superscriptsuperscript mode.
Esc S Ctrl+A Select Subscriptsubscript mode.
Esc T Cancel Superscriptsuperscript/Subscriptsubscript mode.
Esc ( - (n1) (n2) (m) (d1) (d2) Select score.

n1=Ctrl+C

n2=Ctrl+@

m=Ctrl+A

d1 values:

Ctrl+A: underline

Ctrl+B: strike-through

Ctrl+C: overscore

d2 values:

Ctrl+@: Cancel the score line selected by d1

Ctrl+A: Single continuous line.

Ctrl+B: Double continuous line.

Ctrl+E: Single broken line.

Ctrl+F: Double broken line.

Esc - (n) Turn under line mode ON(n=Ctrl+A)/OFF(n=Ctrl+@).
Esc q (n) Select Character Stylestyle.

n values:

Ctrl+@: normal

Ctrl+A: Outlineoutline

Ctrl+B: shadow

Ctrl+C: Outlineoutline with shadow

Word Processing Commands

Command Description
Esc a (n) Select Justificationjustify.

n values:

Ctrl+@: selects left Justificationjustify

Ctrl+A: selects centering

Ctrl+B: selects right Justificationjustify

Ctrl+C: selects full Justificationjustify

Esc Ctrl+` (n) Set intercharacter space. Number of dots determined by n.

Character Tables Commands

Command Description
Esc t (n) Select Character table.

n values:

Ctrl+@: selects Italicsitalic table

Ctrl+A: selects Epson graphics table

Ctrl+B: selects user-defined table and remaps user-defined 0-127 to 128-255

Esc 4 Select italic mode.
Esc 5 Cancel italic mode.
Esc R (n) Select an international Character Setcharset.

n values:

Ctrl+@: USA

Ctrl+A: France

Ctrl+B: Germany

Ctrl+C: England

Ctrl+D: Denmark I

Ctrl+E: Sweden

Ctrl+F: Italy

Ctrl+G: Spain I

Ctrl+H: Japan

Ctrl+I: Norway

Ctrl+J: Denmark II

Ctrl+K: Spain II

Ctrl+L: Latin America

Ctrl+M: Korea

@: Legal

User Defined Characters

Command Description
Esc & Ctrl+@ (d1) (d2) ... (dn) Define user-defined characters.
Esc : Ctrl+@ (n) Ctrl+@ Copy ROM to RAM.

n values

Ctrl+@: Roman

Ctrl+A: Sans Serif

Ctrl+B: Couriercourier

Ctrl+C: Prestige

Ctrl+D: Scriptscript

Ctrl+E: OCR-B

Ctrl+F: OCR-A

Esc % (n) Select user-defined set.

n values

Ctrl+@: selects normal set

Ctrl+A: selects user-defined set

Esc 6 Enable printable characters.
Esc 7 Enable upper control codes.

Graphics Commands

Command Description
Esc K (n1) (n2) Select single-density graphics mode.
Esc L (n1) (n2) Select double-density graphics mode.
Esc Y (n1) (n2) Select high-speed double-density graphics mode.
Esc Z (n1) (n2) Select quadruple-density graphics mode.
Esc * (m) (n1) (n2) Select graphics mode.

m values:

Ctrl+@: single-density 8 pin

Ctrl+A: double density 8 pin

Ctrl+B: high speed double- density 8 pin

Ctrl+C: quadruple density 8 pin

Ctrl+D: CRT I 8 pin

Ctrl+F: CRT II 8 pin

Space: single-density 24 pin

a: double-density 24 pin

g: CRT III 24 pin

h: triple-density 24 pin

i: hex-density 24 pin

Esc ? (s) (m) Reassign graphics mode. S values are(K,L,Y,Z) above. M values same as Esc *m options.

ESC/P2 Revision Printers - Additional Commands

Note: The P2 command set includes all other N9 ROM commands as well as the following new commands:

Command Description
Esc ( c Ctrl+D Ctrl+@ (m1) (m2) (n1) (n2) Set page format. M is top Margin in definedunits. N is bottom Margin in defined units.
Esc ( C Ctrl+B Ctrl+@ (n1) (n2) Set page length in defined n units.
Esc ( V Ctrl+B Ctrl+@ (n1) (n2) Set absolute vertical print position. N specifies print position from top Margin indefined units.
Esc ( v Ctrl+B Ctrl+@(n1) (n2) Set relative vertical print position. N movescurrent print position in defined units.
Esc X (m) (n1) (n2) Select Font by Pitchpitch and Pointpoint. M sets pitchto 360/m CPIcpi. N sets Pointpoint size in 0.5 pointincrements.
Esc ( U Ctrl+A Ctrl+@ (n) Define unit for spacing. N is positioningunit as n/3600 inch.
Esc ( t Ctrl+C Ctrl+@ (d1) (d2) (d3) Assign Character table set by d2 and d3 tod1.
Esc ( ^ (n1) (n2) (data) Print data as characters. N is the amount ofdata and Data is the n byte data for printingas Character.
Esc ( G Ctrl+A Ctrl+@ (n) Select graphics mode.
Esc . (c) (v) (h) (m) (n1) (n2) Print Raster Graphicsrastergr.

c values:

Ctrl+@: full graphics mode

Ctrl+A: compressed mode

v is the vertical dot density in 3600/v DPIdpi

h is the horizontal dot density in 3600/h DPIdpi

m is the number of vertical dots

n is the number of horizontal dots