hp-support-head-portlet

Actions
Loading...

HP Customer Support

hp-contact-secondary-navigation-portlet

Actions
Loading...

hp-share-print-widget-portlet

Actions
Loading...

hp-concentra-wrapper-portlet

Actions
Loading...

HP Color Inkjet Printer cp1160 - PCL Printer Commands

Introduction
Hewlett-Packard developed the PCL printer language to standardize access to printer features. The PCL language provides the highest level of communications between the system and the printer. It is independent of the host system, device driver, I/O interface, and network communications.
This document lists the HP Inkjet PCL printer commands for basic page formatting and font selection. If further information about PCL commands is needed, please contact the HP Customer Support Center.
About using PCL printer commands
There are two general types of PCL commands:
  • Control codes
  • Escape sequences
A Control code is a character that initiates a printer function (for example, Carriage Return (CR), Line Feed (LF), or Form Feed (FF)).
An Escape sequence begins with the ASCII escape character Esc (decimal 27), followed by at least one other character. A PCL device receiving Esc tries to interpret subsequent characters as a PCL command rather than as data to be printed. If the device does not recognize the command, it remains at the text processing level: syntactically correct, but unrecognized escape sequences are ignored; syntactically incorrect sequences are ignored and printed.
Syntax of escape sequences
There are two forms of PCL escape sequences:
  • Two-character escape sequences
  • Parameterized escape sequences
Two-character escape sequences
Two-character escape sequences have the following form: EscX.
Where “X” is a character that defines the operation to be performed.
 note:
“X” may be any character from the ASCII table within the range 48-126 decimal [“0” through ”~”].
Parameterized escape sequences
Parameterized escape sequences have the following form:
  • EscXyz1#z2#z3…# Zn [data] (where y, #, zi (z1, z2, z3…) and [data] might be optional, depending on the command).
  • X Parameterized character: A character from the ASCII table within the range 33 through 47 decimal (“!” through “/”) indicating that the escape sequence is parameterized.
  • Y Group character: A character from the ASCII table within the range 96 through 126 decimal (“’” through “~”), which specifies the group type of control being performed.
  • # Value field: A group of characters specifying a numeric value. The numeric value is represented as an ASCII string of characters within the range 48 through 57 decimal (“0” through “9”) that may be preceded by a plus (+) or minus (-) sign and may contain a fractional portion indicated by the digits after a decimal point (.). Numeric value fields are within the range -32767 to 32767. If an escape sequence requires a value field and a value field is not specified, a value of zero is assumed.
  • Zi Parameter character: Any character from the ASCII table within the range 96 through 126 decimal (“ “ “ through “~”). This character specifies the parameter to which the previous value field applies. This character is used when combining escape sequences.
  • Zn Termination character: Any character from the ASCII table within the range 64 through 96 decimal (“@” through “~”). This character specifies the parameter to which the previous value field applies. This character terminates the escape sequence and is always in the form of a capital letter, such as A, M, T, etc.
Translating between ASCII, Hex, and decimal values
The following table may be used to translate ASCII values into decimal or hexadecimal values.
ASCII value
Dec
Hex
Description
0
48
30
Zero
1
49
31
One
2
50
32
Two
3
51
33
Three
4
52
34
Four
5
53
35
Five
6
54
36
Six
7
55
37
Seven
8
56
38
Eight
9
57
39
Nine
.
46
2E
Period (point)
PCL printer command summary
 note:
The printer commands with an asterisk (*) are listed in the order in which they must be sent. The pound sign (#) indicates the numeric parameter value field.
 note:
Spaces in the escape sequences are for readability and should not appear in actual command.
Printer control
Printer feature
Printer command
Decimal value
Hexadecimal value
Reset
EscE
027 069
1B 45
Self-test
EscZ
027 122
1B 7A
Paper input control (media source)
Printer feature
Printer command
Decimal value
Hexadecimal value
Eject Page
Esc&/l0H
027 038 108 048 072
1B 26 6C 30 48
Upper Tray
Esc&/l1H
027 038 108 049 072
1B 26 6C 31 48
Manual Feed
Esc&/l2H
027 038 108 050 072
1B 26 6C 32 48
Lower Tray
Esc&/l4H
027 038 108 052 072
1B 26 6C 34 48
Auto Select
Esc&/l7H
027 038 108 055 072
1B 26 6C 37 48
Underline
Printer feature
Printer command
Decimal value
Hexadecimal value
Default
Esc&/d0D
027 038 100 048 068
1B 26 64 30 44
Single fixed
Esc&/d1D
027 038 100 049 068
1B 26 64 31 44
Double fixed
Esc&/d2D
027 038 100 050 068
1B 26 64 32 44
Single floating
Esc&/d3D
027 038 100 051 068
1B 26 64 33 44
Double float
Esc&/d4D
027 038 100 052 068
1B 26 64 34 44
Turn off
Esc&/d@
027 038 100 064
1B 26 64 40
Line termination
Printer feature
Printer command
Decimal value
Hexadecimal value
CR=CR; LF=LF; FF=FF
Esc&k0G
027 038 107 048 071
1B 26 6B 30 47
CR=CR + LF; LF=LF, FF=FF
Esc&k1G
027 038 107 049 071
1B 26 6B 31 47
CR=CR; LF=CR + LF; FF=CR + FF
Esc&k2G
027 038 107 050 071
1B 26 6B 32 47
CR=CR + LF; LF=CR + LF; FF=CR +FF
Esc&k3G
027 038 107 051 071
1B 26 6B 33 47
End of line wrap
Printer feature
Printer command
Decimal value
Hexadecimal value
Turn on
Esc&s0C
027 038 115 048 067
1B 26 73 30 43
Turn off
Esc&s1C
027 038 115 049 067
1B 26 73 31 43
Transparent print mode
Printer feature
Printer command
Decimal value
Hexadecimal value
# of bytes
Esc&p#X[data]
027 038 112 # 088 [data]
1B 26 70 # 58 [data]
Display functions mode
Printer feature
Printer command
Decimal value
Hexadecimal value
Turn on
EscY
027 089
1B 59
Turn off
EscZ
027 090
1B 5A
Page control
Page orientation*
Printer feature
Printer command
Decimal value
Hexadecimal value
Portrait
Esc&/l0O
027 038 108 048 079
1B 26 6C 30 4F
Landscape
Esc&/1O
027 038 108 049 079
1B 26 6C 31 4F
Print quality
Printer feature
Printer command
Decimal value
Hexadecimal value
Economy/Draft
Esc*o-1M
027 042 111 046 049 077
1B 2A 6F 2E 31 4D
Normal
Esc*o0M
027 042 111 048 077
1B 2A 6F 30 4D
Best
Esc*o1M
027 042 111 049 077
1B 2A 6F 31 4D
Media type
Printer feature
Printer command
Decimal value
Hexadecimal value
Plain Paper
Esc&/0M
027 038 108 048 077
1B 26 6C 30 4D
Bond Paper
Esc&/1M
027 038 108 049 077
1B 26 6C 31 4D
Special
Esc&/2M
027 038 108 050 077
1B 26 6C 32 4D
Glossy Paper
Esc&/3M
027 038 108 051 077
1B 26 6C 33 4D
Paper size*
Printer feature
Printer command
Decimal value
Hexadecimal value
U.S. Executive
Esc&/1A
027 038 108 049 065
1B 26 6C 31 41
U.S. Letter
Esc&/2A
027 038 108 050 065
1B 26 6C 32 41
U.S. Legal
Esc&/3A
027 038 108 051 065
1B 26 6C 33 41
JIS A5
Esc&/2A
027 038 108 050 055 065
1B 26 6C 32 35 41
JIS A4
Esc&/6A
027 038 108 050 054 065
1B 26 6C 32 36 41
Hagaki Card
Esc&/71A
027 038 108 055 049 065
1B 26 6C 37 31 41
ISO A6 Card
Esc&/73A
027 038 108 055 051 065
1B 26 6C 37 33 41
U.S. - 4 x 6 Card
Esc&/74A
027 038 108 055 052 065
1B 26 6C 37 34 41
U.S. - 5 x 8 Card
Esc&/75A
027 038 108 055 053 065
1B 26 6C 37 35 41
U.S. - 3 x 5 Card
Esc&l78A
027 038 108 055 056 065
1B 26 6C 37 38 41
No. 10 Envelope
Esc&/81A
027 038 108 045 056 049 065
1B 26 6C 38 31 41
Int'l DL envelope
Esc&/90A
027 038 108 057 048 065
1B 26 6C 39 30 41
Int'l C6 envelope
Esc&/92A
027 038 108 057 050 065
1B 26 6C 39 32 41
Custom
Esc&/101A
027 038 108 049 048 049 065
1B 26 6C 31 30 31 41
A2 Envelope
Esc&/109A
027 038 108 049 048 057 065
1B 26 6C 31 30 39 41
NEC Long4 Envelope
Esc&/111A
027 038 108 049 049 049 065
1B 26 6C 31 31 31 41
HP Greeting Card
Esc&/114A
027 038 108 049 049 052 065
1B 26 6C 31 31 34 41
Line spacing
Printer feature
Printer command
Decimal value
Hexadecimal value
Lines per inch
(# of lines)
Esc&/#D
027 038 108 # 068
1B 26 6C # 44
Page length*
Printer feature
Printer command
Decimal value
Hexadecimal value
# of lines, (5-128 are valid)
Esc&/#P
027 038 108 # 080
1B 26 6C # 50
Perforation skip mode*
Printer feature
Printer command
Decimal value
Hexadecimal value
Off
Esc&/0L
027 038 108 048 076
1B 26 6C 30 4C
On
Esc&/1L
027 038 108 049 076
1B 26 6C 31 4C
Margins*
Printer feature
Printer command
Decimal value
Hexadecimal value
Top (# of lines)
Esc&/#E
027 038 108 # 069
1B 26 6C # 45
Clear Side Margins
Esc9
027 057
1B 39
Left (column #)
Esc&a#L
027 038 097 # 076
1B 26 61 # 4C
Right (column #)
Esc&a#M
027 038 097 # 077
1B 26 61 # 4D
Text length*
Printer feature
Printer command
Decimal value
Hexadecimal value
# of lines
Esc&/#F
027 038 108 # 070
1B 26 6C # 46
Cursor positioning
Printer feature
Printer command
Decimal value
Hexadecimal value
Horizontal motion index, # of 1/120th inch moves
Esc&k#H
027 038 107 # 072
1B 26 6B # 48
Horizontal move (to column #)
Esc&a#C
027 038 097 # 067
1B 26 61 # 43
Horizontal move (# of decipoints)
Esc&a#H
027 038 097 # 072
1B 26 61 # 48
Horizontal move (# of PCL units)
Esc*p#X
027 042 112 # 088
1B 2A 70 # 58
Vertical motion index, # of 1/48th inch moves
Esc&/#C
027 038 108 # 067
1B 26 6C # 43
Vertical move (to row #)
Esc&a#R
027 038 097 # 082
1B 26 61 # 52
Vertical move (# of decipoints)
Esc&a#V
027 038 097 # 086
1B 26 61 # 56
Vertical move (# of PCL units)
Esc*p#Y
027 042 112 # 089
1B 2A 70 # 59
Font selection
Symbol set*
Printer feature
Printer command
Decimal value
Hexadecimal value
HP Roman 8
Esc(8U
027 040 056 085
1B 28 38 55
PC-8 (IBM-8)
Esc(10U
027 040 049 048 085
1B 28 31 30 55
PC-8 Danish / Norwegian
Esc(11U
027 040 049 049 085
1B 28 31 31 55
PC-850
Esc(12U
027 040 049 050 085
1B 28 31 32 55
HP Legal
Esc(1U
027 040 049 085
1B 28 31 55
United Kingdom (ISO 4)
Esc(1E
027 040 049 069
1B 28 31 45
ANSI ASCII (ISO 6)
Esc(0U
027 040 048 55
1B 28 30 5
Swedish names (ISO 11)
Esc(0S
027 040 048 083
1B 28 30 53
Italian (ISO 15)
Esc(0I
027 040 048 073
1B 28 30 49
Spanish (ISO 17)
Esc(2S
027 040 050 083
1B 28 32 53
German (ISO 21)
Esc(1G
027 040 049 071
1B 28 31 47
Norwegian1 (ISO 60)
Esc(0D
027 040 048 068
1B 28 30 44
French (ISO 69)
Esc(1F
027 040 049 070
1B 28 31 46
ISO 8859/1 Latin-1 (ECMA 94)
Esc(0N
027 040 048 078
1B 28 30 4E
ISO 8859/2 Latin-2
Esc(2N
027 040 050 078
1B 28 32 4E
ISO 8859/5 Latin/Cyrillic
Esc(10N
027 040 049 048 078
1B 28 31 30 4E
ISO 8859/9 Latin-5
Esc(5N
027 040 053 078
1B 28 35 4E
PC-852 Latin-2
Esc(17U
027 040 049 055 085
1B 28 31 37 55
PC-8 Turkish
Esc(9T
027 040 057 084
1B 28 39 54
Spacing*
Printer feature
Printer command
Decimal value
Hexadecimal value
Proportional
Esc(s1P
027 040 115 049 080
1B 28 73 31 50
Fixed
Esc(s0P
027 040 115 048 080
1B 28 73 30 50
Print pitch*
Printer feature
Printer command
Decimal value
Hexadecimal value
# of characters per inch
Esc(s#H
027 040 115 # 072
1B 28 73 # 48
Point size (character height)*
Printer feature
Printer command
Decimal value
Hexadecimal value
# of 1/72nd inch
Esc(s#V
027 040 115 # 086
1B 28 73 # 56
Style*
Printer feature
Printer command
Decimal value
Hexadecimal value
Upright (normal)
Esc(s0S
027 040 115 048 083
1B 28 73 30 53
Italic
Esc(s1S
027 040 115 049 083
1B 28 73 31 53
Stroke weight*
Printer feature
Printer command
Decimal value
Hexadecimal value
Normal
Esc(s0B
027 040 115 048 066
1B 28 73 30 42
Bold
Esc(s3B
027 040 115 051 066
1B 28 73 33 42
Typeface*
Printer feature
Printer command
Decimal value
Hexadecimal value
Courier
Esc(s3T
027 040 115 051 084
1B 28 73 33 54
CG Times
Esc(s4101T
027 040 115 052 049 048 049 084
1B 28 73 34 31 30 31 54
Letter Gothic
Esc(s6T
027 040 115 054 084
1B 28 73 36 54
Univers
Esc(s52T
027 040 115 053 050 084
1B 28 73 35 32 54
Times New Roman
Esc(s517T
027 040 115 053 049 055 084
1B 28 73 35 31 37 54
Arial
Esc(s218T
027 040 115 050 049 056 084
1B 28 73 32 31 38 54
Symbol
Esc(s302T
027 040 115 051 048 050 084
1B 28 73 33 30 32 54
Wingdings
Esc(s2730T
027 040 115 050 055 051 048 084
1B 28 73 32 37 33 30 54
Raster graphics
Start raster graphics
Printer feature
Printer command
Decimal value
Hexadecimal value
At left most position
Esc*r0A
027 042 114 048 065
1B 2A 72 30 41
Current Cursor Position
Esc*r1A
027 042 114 049 065
1B 2A 72 31 41
End raster graphics
Printer feature
Printer command
Decimal value
Hexadecimal value
End Graphics
Esc*rC
027 042 114 067
1B 2A 72 43
Resolution
Printer feature
Printer command
Decimal value
Hexadecimal value
75 dots per inch
Esc*t75R
027 042 116 055 053 082
1B 2A 74 37 35 52
100 dots per inch
Esc*t100R
027 042 116 049 048 048 082
1B 2A 74 31 30 30 52
150 dots per inch
Esc*t150R
027 042 116 049 053 048 082
1B 2A 74 31 35 30 52
300 dots per inch
Esc*t300R
027 042 116 051 048 048 082
1B 2A 74 33 30 30 52
600 dots per inch (black only)
Esc*t600R
027 042 116 054 048 048 082
1B 2A 74 36 30 30 52
Raster depletion
Printer feature
Printer command
Decimal value
Hexadecimal value
No depletion
Esc*o1D
027 042 111 049 068
1B 2A 6F 31 44
Raster quality obsolete
Printer feature
Printer command
Decimal value
Hexadecimal value
Default
Esc*r0Q
027 042 114 048 081
1B 2A 72 30 51
Draft
Esc*r1Q
027 042 114 049 081
1B 2A 72 31 51
High
Esc*r2Q
027 042 114 050 081
1B 2A 72 32 51
Set raster graphics width
Printer feature
Printer command
Decimal value
Hexadecimal value
# of pixels
Esc*r#S
027 042 114 # 083
1B 2A 72 # 53
Set raster graphics compression
Printer feature
Printer command
Decimal value
Hexadecimal value
None (off)
Esc * b 0 M
027 042 098 048 077
1B 2A 62 30 4D
Method 1
Esc * b 1 M
027 042 098 049 077
1B 2A 62 31 4D
Method 2
Esc*b2M
027 042 098 050 077
1B 2A 62 32 4D
Method 3
Esc*b3M
027 042 098 051 077
1B 2A 62 33 4D
Method 9
Esc*b9M
027 042 098 057 077
1B 2A 62 39 4D
Seed Row Source
Esc*b#S
027 042 098 # 083
1B 2A 62 # 53
Seed row source
Printer feature
Printer command
Decimal value
Hexadecimal value
Same plane of previous row
Esc*b0S
027 042 098 # 083
1B 2A 62 # 53
Previous plane
Esc*b1S
027 042 098 # 083
1B 2A 62 # 53
Second previous
Esc*b2S
027 042 098 # 083
1B 2A 62 # 53
Third previous
Esc*b3S
027 042 098 # 083
1B 2A 62 # 53
Transfer raster graphics
Printer feature
Printer command
Decimal value
Hexadecimal value
Transfer by row (# of bytes)
Esc*b#W[data]
027 042 098 # 087 [data]
1B 2A 62 # 57 [data]
Transfer by plane (# of bytes)
Esc*b#V[data]
027 042 098 # 086 [data]
1B 2A 62 # 56 [data]
Relative vertical pixel movement (formerly known as Raster Y offset)
Printer feature
Printer command
Decimal value
Hexadecimal value
Relative # of dots
Esc*b#Y
027 042 098 # 089
1B 2A 62 # 59
Set number of raster planes per row
Printer feature
Printer command
Decimal value
Hexadecimal value
Four planes, KCMY palette
Esc*r-4U
027 042 114 045 052 085
1B 2A 72 2D 34 55
Three planes, CMY palette
Esc*r-3U
027 042 114 045 051 085
1B 2A 72 2D 33 55
K (black plane)
Esc*r1U
027 042 114 049 085
1B 2A 72 31 55
Three planes, RGB palette
Esc*r3U
027 042 114 051 085
1B 2A 72 33 55
Text (Foreground color) - Assumes KCMY four-plane palette selected
Printer feature
Printer command
Decimal value
Hexadecimal value
White (no ink)
Esc*v0S
027 042 118 048 083
1B 2A 76 30 53
True black
Esc*v1S
027 042 118 049 083
1B 2A 76 31 53
Cyan
Esc*v2S
027 042 118 050 083
1B 2A 76 32 53
Magenta
Esc*v4S
027 042 118 052 083
1B 2A 76 34 53
Blue
Esc*v6S
027 042 118 054 083
1B 2A 76 36 53
Yellow
Esc*v8S
027 042 118 056 083
1B 2A 76 38 53
Green
Esc*v10S
027 042 118 049 048 083
1B 2A 76 31 30 53
Red
Esc*v12S
027 042 118 049 050 083
1B 2A 76 31 32 53
Composite black
Esc*v14S
027 042 118 049 052 083
1B 2A 76 31 34 53

hp-feedback-input-portlet

Actions
Loading...

hp-online-communities-portlet

Actions
Loading...

Ask the community!


Support Forum

Support Forum

Join the conversation! Find Solutions, ask questions, and share advice with other HP product owners. Visit now


hp-feedback-banner-portlet

Actions
Loading...

hp-country-locator-portlet

Actions
Loading...
Country: Flag United States

hp-detect-load-my-device-portlet

Actions
Loading...