IBM Support

List of Common HP PCL5 Commands Used by Host Print Transform (HPT)

Troubleshooting


Problem

This document provides information on common HP PCL5 commands that are used by Host Print Transform (HPT).

Resolving The Problem

Note: The ASCII command strings, command names, and descriptions were taken from the HP PCL5 Printer Language Technical Reference Manual and the HP PCL5 Comparison Guide Addendum that are available from Hewlett Packard website.

Control Codes
Control Code (Hexadecimal) Control Code Name (and Description)
00 Null (NUL)

The Null (NUL) control code performs No Operation.
0A Line Feed (LF)

The Line Feed (LF) control code advances the current active position (CAP) to the same horizontal position on the next line. The distance to the next line is defined by the current line spacing (defined by the last VMI or line spacing setting).
0D Carriage Return (CR)

The Carriage Return (CR) control code moves the current active position (CAP) to the left margin on the current line.
0C Form Feed (FF)

The Form Feed (FF) control code advances the current active position (CAP) to the same horizontal position at the top of the text area on the next page.
1B Escape (ESC)

PCL printer commands consist of two or more characters. The first character is always the ASCII escape character, identified by the Ec symbol. Ec is a special control code which identifies the subsequent string of characters as a printer command. As the printer monitors incoming data from a computer, it “looks” for this character. When this character appears, the printer reads it and its associated characters as a command to perform and not as data to print.

Note: PCL printer commands (other than single-character control codes) are often referred to as escape sequences.
20 Space (SP)

The Space (SP) control code moves the current active position (CAP) to the right by one column position. Space may be a printable character or a control code. If a character is defined for the Space code, Space is printable; otherwise, it is a control code. For proportionally spaced fonts, a Space control code moves the cursor by the current HMI value; however, a printable space moves the cursor the width of the character. For fixed pitch fonts, a space, whether control code or printable, moves the cursor according to the HMI value.
08 Backspace (BS)

The Backspace (BS) control code moves the current active position (CAP) left a distance equal to the width of the last printed symbol or space. If the active position is already at the left margin, no action is taken. If the cursor is currently beyond the right margin, BS positions the cursor just to the left of the right margin. When using fixed pitch fonts, the Backspace distance is defined by the current print pitch (HMI setting).

When using proportionally-spaced fonts, a single Backspace moves back to center the overstrike character. After printing the overstriking character, the cursor returns to its position prior to the Backspace. Multiple backspaces each move back the distance of the last printed symbol or space. For example, if “world” was printed with a proportional font and then 5 backspaces were performed, the distance moved back would be five times the width of the “d.”
09 Horizontal Tab (HT)

The Horizontal Tab (HT) control code moves the current active position (CAP) to the next tab stop on the current line. The tab stops are at the left margin and every 8th column between the left margin and the right bound of the logical page. If the new horizontal position crosses the right margin, the new horizontal position is set to the right margin. If the current HMI value is 0, the command is ignored.

PCL Printer Commands or Escape Sequences
PCL Command (ASCII / Hex) PCL Printer Command Name (and Description)
Ec E

1B45
Printer Reset Command

A Printer Reset restores the User Default Environment and deletes
temporary fonts, macros, user-defined symbol sets, and patterns.
Ec ( ID

1B28......

Ec ) ID

1B29......
Symbol Set Command

The Symbol Set command identifies the specific set of symbols in a font. “Symbols” are the alphanumeric, punctuation, or any other printable characters or symbols which may be included.

EC ( ID Primary Symbol Set Command
EC ) ID Secondary Symbol Set Command

Default = 8U
Range = N/A

Typical symbol set IDs include:

ID 1F (3146) = ISO 69 French
0N (304E) = ISO 8859-1 Latin 1 (ECMA-94)
0U (3055) = ISO 6:ASCII
1U (3155) = Legal
8U (3855) = Roman-8
10U (313055) = PC-8
0Y (3059) = 3 of 9 Barcode
19U (313955) = Windows 3.1 Latin 1 (ANSI)
Ec ( s # B
Ec ( s # b

1B2873..42
1B2873..62

Ec ) s # B
Ec ) s # b

1B2973..42
1B2973..62
Stroke Weight Command

The Stroke Weight command designates the thickness of the strokes that compose the characters of a font.

EC ( s # B - Primary stroke weight
EC ) s # B - Secondary stroke weight

The primary stroke weight command specifies the stroke weight used for the primary font and the secondary stroke weight command specifies the stroke weight used for the secondary font.

# = -7 Ultra Thin
-6 Extra Thin
-5 Thin
-4 Extra Light
-3 Light
-2 Demi Light
-1 Semi Light
0 Medium, Book,
1 Semi Bold
2 Demi Bold
3 Bold
4 Extra Bold
5 Black
6 Extra Black
7 Ultra Black
Ec ( s # H
Ec ( s # h

1B2873..48
1B2873..68

Ec ) s # H
Ec ) s # h

1B2973..48
1B2973..68
Pitch Command

The Pitch command designates the horizontal spacing of a fixed- spaced (bitmap or scalable) font in terms of the number of characters per inch. This characteristic is ignored when selecting a proportionally-spaced (bitmap or scalable) font, but is saved in the font select table and available when a fixed-spaced font is selected.

EC ( s # H - Primary pitch
EC ) s # H - Secondary pitch

The primary pitch command specifies the pitch used for the primary font and the secondary pitch command specifies the pitch used for the secondary font.

# = # = Pitch in characters/inch
Default = 10
Range = 0.00

The value field (#) is valid to two decimal places.
Ec ( s # P
Ec ( s # p

1B2873..50
1B2873..70

Ec ( s # P
Ec ( s # p

1B2973..50
1B2973..70
Spacing Command

Inter-character spacing can be specified as either proportional or fixed.

Ec ( s # P - Primary spacing
Ec ) s # P - Secondary spacing

The primary spacing command specifies the spacing used for the primary font and the secondary spacing command specifies the spacing used for the secondary font.

# = 0 - Fixed spacing
1 - Proportional spacing

Default = 0
Range = 0, 1 (values outside the range are ignored)
Ec ( s # Q
Ec ( s # q

1B2873..51
1B2873..71
Print Quality Command

The print quality can be specified as either draft or Near-Letter Quality (NLQ).

# = 1 - Draft quality
2 - Near-Letter Quality (NLQ)

Note: This PCL command is sent only by Host Print Transform (HPT) for specific MFRTYPMDL settings for HP PCL capable ink jet printers including *HP500, *HP520 and *IBM4076.
Ec ( s # S
Ec ( s # s

1B2873..53
1B2873..73

Ec ) s # S
Ec ) s # s

1B2973..53
1B2973..73
Style Command

The Style command identifies the posture of a character, its width, and structure of the font symbols.

EC ( s # S - Primary Style
EC ) s # S - Secondary Style


The primary style command specifies the style used for the primary font and the secondary style command specifies the style used for the secondary font.

Default = 0
Range = 0 - 32767 (values greater than 32767 are set to 32767)
Style values for the most common typefaces are:

0 (upright, solid)
1 italic
4 condensed
5 condensed italic
8 compressed, or extra condensed
24 expanded
32 outline
64 inline
128 shadowed
160 outline shadowed
Ec ( s # T
Ec ( s # t

1B2873..54
1B2873..74

Ec ) s # T
Ec ) s # t

1B2973..54
1B2973..74
Typeface Family Command

The Typeface Family command designates the design of the font.

EC ( s # T - Primary typeface family
EC ) s # T - Secondary typeface family

The primary typeface family command specifies the typeface family used for the primary font and the secondary typeface family command specifies the typeface family used for the secondary font.

# = Typeface family value (see Appendix C in the PCL 5
Comparison Guide for typeface values).
Default = 14099, Body Text
Range = 10 - 65535 (values greater than 65535 are set to 65535)
Ec ( s # V
Ec ( s # v

1B2873..56
1B2873..76

Ec ) s # V
Ec ) s # v

1B2973..56
1B2973..76
Height Command

The Height command specifies the height of the font in points. This characteristic is ignored when selecting a fixed-spaced scalable font; however, the value is saved and available when a bitmap font or a proportionally-spaced scalable font is selected.

EC ( s # V - Primary Height
EC ) s # V - Secondary Height

# = Height in points
Default = 12
Range = 0.25 - 999.75
Ec & d # D

1B2664..44

Ec & d @

1B266440
Underline Command

The Underline command controls automatic text underlining.

Ec & d # D - Enable underline

# = 0 - Fixed position
3 - Floating position

Default = 0

Range = 0, 3 (values outside range are ignored)

Ec & d @ - Disable underline
Ec & a # H

1B2661..48


1B26612B..48
1B26612D..48
Horizontal Cursor Positioning (in Decipoints)

The Horizontal Cursor Positioning (in Decipoints) command moves the cursor to a new position along the x-axis.

# = Decipoint position (1/720 inch), valid to 2 decimal places.
Ec & a # P

1B2661..50




1B26613050
1B2661393050
1B266131383050
1B266132373050
Print Direction Command

The Print Direction command rotates the logical page coordinate system with respect to the current orientation without performing a page eject. This rotation is performed in 90° increments in a counterclockwise direction. This allows printing in four directions on the same page.

# = 0 - 0° rotation.
90 - 90° ccw rotation.
180 - 180° ccw rotation.
270 - 270° ccw rotation.
Ec & a # R

1B2661..52
Vertical Cursor Positioning (Rows) Command

This Vertical Cursor Positioning command moves the cursor to a new line in the same column position.

# = Number of Rows
Default = NA
Range = –32767 to 32767 (valid to 4 decimal places)
Ec & a # V

1B2661..56
Vertical Cursor Positioning (Decipoints) Command

This Vertical Cursor Positioning command moves the cursor to a new position along the vertical axis.

# = Number of Decipoints (1/720 inch)

Default = NA

Range = –32767 to 32767 (rounded to the first decimal place)
Ec & l # A

1B266C..41



1B266C3141
1B266C3241
1B266C3341
1B266C3641
1B266C313041
1B266C323541
1B266C323641
1B266C323741
1B266C343541
1B266C343641
1B266C373141
1B266C373241


1B266C383041
1B266C383141
1B266C393141
1B266C393241
1B266C31303041
1B266C31303141
Page Size Command

The Page Size command designates the size of the paper which in turn defines the size of the logical page.

PAPER:
# = 1 - Executive (7¼ x 10½ in.)
2 - Letter (8½ x 11 in.)
3 - Legal (8½ x 14 in.)
6 - Ledger (11 x 17 in.)
10 - JISExec (Foolscap)
25 - A5 (148mm x 210mm)
26 - A4 (210mm x 297mm)
27 - A3 (297mm x 420mm)
45 - JIS B5 (176mm x 250mm)
46 - JIS B4 (250mm x 353mm)
71 - Hagaki Postcard
72 - Oufuku-Hagaki Postcard

ENVELOPES:
# = 80 - Monarch (Letter - 3 7/8 x 7½ in.)
81 - Com-10 (Business - 4 1/8 x 9½ in.)
90 - International DL (110mm x 220mm)
91 - International C5 (162mm x 229mm)
100 - International B5 (176mm x 250mm)
101 - Custom

Default = 2 (Configurable from Control Panel)
Ec & l # C

1B266C..43
Vertical Motion Index (VMI) Command

The Vertical Motion Index (VMI) command designates the height of the rows. (The vertical distance the cursor moves for a Line Feed operation.)

# = number of 1/48 inch increments between rows.
Ec & l # E

1B266C..45
Top Margin Command

The Top Margin command designates the number of lines between the top of the logical page and the top of the text area.

# = Number of lines
Default = 1/2 inch down from top of logical page1
Range = 0 - Length of logical page (Other values ignored)
Ec & l # F

1B2662..46
Text Length Command

The Text Length command designates the number of lines (at a given VMI) within the logical page available for printing text, the text area. This effectively defines the bottom margin.

# = Number of lines
Default = 1/2 inch less than maximum text length
Range = Logical page length minus top margin
Ec & l # G

1B266C..47


1B266C3147
1B266C3247
Output Bin Selection Command

The Output Bin Selection command selects either of the two output paper bins (upper or lower [rear]) for paper output.

# = 1 - Upper Output Bin
2 - Lower (Rear) Output Bin
Ec & l # H

1B266C..48


1B266C3048
1B266C3148
1B266C3248
1B266C3348
1B266C3448
1B266C3548
1B266C3648
1B266C3748
Paper Source Command

The Paper Source command designates the location to feed paper, or it prints the current page.

# = 0 - Print the current page (paper source remains unchanged).
1 - Feed paper from the a printer-specific tray.
2 - Feed paper from manual input.
3 - Feed envelope from manual input.
4 - Feed paper from lower tray.
5 - Feed from optional paper source.
6 - Feed envelope from optional envelope. feeder
7 - Auto select
Ec & l # O

1B266C..4F
Logical Page Orientation Command

Orientation defines the position of the logical page and the default direction of print with respect to the physical page.

# = 0 - Portrait
1 - Landscape
2 - Reverse Portrait
3 - Reverse Landscape
Ec & l # S

1B266C..53
Simplex/Duplex Print Command

This command designates either simplex duplex printers. Simplex mode prints an sheet (page). Duplex mode prints images

# = 0 - Simplex
1 - Duplex, Long-Edge
2 - Duplex, Short-Edge
Default = 0
Range = 0-2 (Other values ignored)
Ec & l 1 T

1B266C3154
Job Separation Command

Job separation provides a means of identifying one print job from others in the printer’s output tray. It usually does this by physically offsetting one print job from the next. The Job Separation command toggles the printer’s separation mechanism. This command must be sent between each job to enable the separation mechanism.

Note: Host Print Transform (HPT) sends this HP PCL command at the beginning of a *SCS spooled files even if it is not specifically mentioned in a Jog Output Tray (JOGOUTTRAY) tag in a system-supplied Workstation Customizing Object (WSCST). However, it does not send this command at the beginning of *AFPDS spooled files.
Ec & l # U

1B266C..55
Left (Long-Edge) Offset Registration Command

The Left (Long-Edge) Offset Registration command designates the position of the logical page across the width (short side) of the physical page. This command can be used to adjust the text position on the page to allow additional room for the page binding.

# = The number of decipoints (1/720 inch)
Default = 0
Range = –32767 to 32767

Note: Host Print Transform (HPT) does not use this PCL5 command in its system-supplied Workstation Customizing Objects (WSCSTs), but it is sometimes added to a modifed WSCST object to change the positioning of the text on the page.
Ec & l # X

1B266C..58
Number of Copies Command

The Number of Copies command designates the number of printed copies of each page.

? & l # X
# = Number of copies (1 to 32767 maximum)

Default = 1 (Configurable from control panel)
Range = 1-32767
(Values 32767 execute as 32767 values 1 are ignored.
Maximum number of copies=99 for LaserJet II, IIP, III, IIID, IIIP
and earlier LaserJet printers.)

This command can be received anywhere within a page and affects the current page as well as subsequent pages.

Note: Host Print Transform (HPT) does not use this PCL5 command in its system-supplied Workstation Customizing Objects (WSCSTs), but '1B266C3158'X (Number of Copies = 1) is sometimes added to the INITPRT tag in a modifed WSCST object to override the number of copies specified in the printer hardware.
Ec & l # Z

1B266C..5A
Top (Short-Edge) Offset Registration Command

The Top (Short-Edge) Offset Registration position of the logical page along page.

# = The number of
Default = 0
Range = –32767 to 32767

Note: Host Print Transform (HPT) does not use this PCL5 command in its system-supplied Workstation Customizing Objects (WSCSTs); however, it is sometimes added to a modified WSCST object to change the positioning of the text on the page.
Ec & l # L

1B266C..4C
Perforation Skip Command

The perforation region is the distance from the bottom of the text area of one page to the top of the text area (top margin) of the next page. When perforation skip is enabled, a Line Feed or Half-Line Feed, which would move the cursor beyond the bottom of the text area, causes the cursor to move to the top of the text area on the next page. When perforation skip is disabled, a Line Feed or Half-Line Feed allows the cursor to move to the next line or half-line in the perforation region, allowing printing to continue there.

# = 0 - Disable
1 - Enable

Note: Host Print Transform (HPT) does not use this PCL5 command in its system-supplied Workstation Customizing Objects (WSCSTs); however, it is sometimes added to a modified WSCST object to change the positioning of the text on the page.
Ec & n # Paper Type Command

Bond
Ec&n5WdBond
1B266E355764426F6E64

Plain
Ec&n6WdPlain
1B266E365764506C61696E

Color
Ec&n6WdColor
1B266E365764436F6C6F72

Rough
&n6WdRough
1B266E36526F756768

Heavy
&n6WdHeavy
1B266E364865617679

Gloss
&n6WdGloss
1B266E36476C6F7373

Labels
Ec&n7WdLabels
1B266E3757644C6162656C73

Vellum
&n7WdVellum
1B266E3756656C6C759D

Default
&n8WdDefault
1B266E3844656661756C74

Recycled
Ec&n9WdRecycled
1B266E39576452656379636C6564

Cardstock
Ec&n10WdCardstock
1B266E313057644361726473746F636B

Letterhead
Ec&n11WdLetterhead
1B266E313157644C657474657268656164

Card Stock
Ec&n11WdCard Stock
1B266E31315764436172642053746F636B

Prepunched
Ec&n11WdPrepunched
1B266E3131576450726570756E63686564

Preprinted
Ec&n11WdPreprinted
1B266E313157645072657072696E746564

Transparency
Ec&n13WdTransparency
1B266E313357645472616E73706172656E6379

CustomType
Ec&n#WdCustomType
1B266E.... (depends on the custom paper type specified in the printer hardware)

Notes: Host Print Transform (HPT) does not use this PCL5 command in its system-supplied Workstation Customizing Objects (WSCSTs); however, it is sometimes added to a modified WSCST object to select a paper tray that has been assigned a particular paper type. By default, HPT will generate a PCL data stream that does not include a Paper Type command. Therefore, the printer chooses to use a paper tray that has a paper type of PLAIN.

Also, not all paper types and PCL5 Paper Type commands are available or will work with all printers.
Ec * p # X
Ec * p # x

1B2A70..58
1B2A70..78
Horizontal Cursor Positioning (PCL Units) Command

The Horizontal Cursor Positioning (PCL Units) command moves the cursor to a new position along the horizontal axis.

A value field (#) with a plus sign (+) indicates the new position is to the right of and relative to the current cursor position; a minus sign (–) indicates the new position is to the left of and relative to the current cursor position. No sign indicates an absolute distance which is referenced from the left edge of the logical page. The left most
position is 0 and the right most position is the right bound of the logical page.

If a request is made for a location outside the printer’s logical page, the current active position (CAP) is moved to the appropriate logical page limit.

Note: The current unit size used in PCL Unit moves is determined by the value specified in the Unit of Measure command. If no other value is specified, the number of units-per-inch for PCL unit moves is one unit equals 1/300 inch.
Ec * p # Y
Ec * p # y

1B2A70..59
1B2A70..79
Vertical Cursor Positioning (PCL Units) Command

The Vertical Cursor Positioning (PCL Units) command moves the cursor to a new position along the vertical axis.

A value field (#) with a plus sign (+) indicates the new position is downward from and relative to the current cursor position; a minus sign (–) indicates the new position is upward from and relative to the current cursor position. No sign indicates an absolute distance from the top margin. The top position, defined by the top margin, is 0 and the bottom position is determined by the bottom of the logical page.

Note: Since the top margin can be changed using a printer command, the physical location of the point (0,0) may change. This affects the cursor position on the page.

If a request is made for a location outside the printer’s logical page, the current active position (CAP) is moved to the appropriate logical page limit.

Note: The current unit size used in PCL Unit moves is determined by the value specified in the Unit of Measure command. If no other value is specified, the number of units-per-inch for PCL unit moves is one unit equals 1/300 inch.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CP9AAM","label":"Print-\u003EHost Print Transform or HPT"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

Modified date:
03 January 2025

UID

nas8N1014523