 |
» |
|
 |
|
 |
 |
 |
|
|
HP LaserJet Series Printers - Understanding Printer Command Languages
 Overview
Most software applications do not require entering printer commands. See the appropriate computer and software documentation to find the proper method for entering printer commands, if needed.
PCL
PCL printer commands tell the printer which tasks to perform or which fonts to use. This document provides a quick reference for users who are already familiar with PCL command structure.
HP-GL/2
The printer has the ability to print vector graphics using the HP-GL/2 graphics language. Printing in the HP-GL/2 language requires that the printer leave PCL language and enter HP-GL/2 mode, which can be done by sending the printer PCL code. Some software applications switch languages through their drivers.
PJL
HP’s Printer Job Language (PJL) provides control above PCL and other printer languages. The four major functions provided by PJL are:
PJL commands may be used to change printer default settings.
|
NOTE:
|
The table at the end of this document contains commonly used PCL 5e commands. For a complete listing and explanation of how to use PCL, HP-GL/2, and PJL commands, order the PCL 5/PJL Technical Reference Documentation Package
. |
Understanding PCL printer command syntax
Many printer commands use the lowercase letter l (l) and the number one (1), or the uppercase letter O (O) and the number zero (0). These characters may not appear on the screen as shown in Figure 1. The exact character and case specified for PCL printer commands must be used.
Figure 1: Examples of commonly mistaken characters
The elements of a typical printer command are listed in Figure 2.
Figure 2: Elements of typical printer command
1 - Escape character (begins escape sequence)
2 - Category of command
3 - Value field (contains both alpha and numeric characters)
4 - Uppercase letter (terminates escape sequence)
Combining escape sequences
Escape sequences may be combined into one escape sequence string. There are three important rules to follow when combining code:
The first two characters after the EC character (the parameterized and group characters) must be the same in all of the commands to be combined.
When combining escape sequences, change the uppercase (termination) character in each individual escape sequence to lower case.
The final character of the combined escape sequence must be uppercase.
The following is an example of an escape sequence string that would be sent to the printer to select legal paper, landscape orientation, and eight lines per inch:
EC&l3AEC&l1OEC&l8D
The following escape sequence sends the same printer commands by combining them into a shorter sequence:
EC&l3a1o8D
Entering escape characters
Printer commands always begin with the escape character (EC). The following table shows how the escape character can be entered from various DOS software applications.
| DOS Software Application
|
Entry
|
What Appears
|
| Lotus 1-2-3 and Symphony
|
Type \027
|
027
|
| Microsoft (R) Word for DOS
|
Hold down Alt
and type 027
on the numeric keypad
|
<--
|
| WordPerfect for DOS
|
Type <27>
|
<27>
|
| MS-DOS (R) Edit
|
Hold down Ctrl-P
, and press Esc
|
<--
|
| MS-DOS Edlin
|
Hold down Ctrl-V
, and press [
|
^[
|
| dBase
|
?? CHR (27)+"command"
|
?? CHR (27)+" "
|
Selecting PCL Fonts
PCL printer commands for selecting fonts can be found on the PCL Font List. There are two variable boxes for symbol set and point size. These variables must be filled in or the printer will use defaults.
Figure 3: Variable boxes for symbol set and point size
For example, to produce a symbol set that contains line-draw characters, select the 10U (PC-8) or 12U (PC-850) symbol set. Other common symbol set codes is listed in the table at the end of this document.
|
NOTE:
|
Fonts are either "fixed" or "proportional" in spacing. The printer contains both fixed fonts (Courier, Letter Gothic, and Lineprinter) and proportional fonts (CG Times, Arial (R), Times New Roman, and others). Fixed-spaced fonts are generally used in applications such as spreadsheets and databases, where it is important for columns to line up vertically. Proportional-spaced fonts are generally used in text and word processing applications. |
Common PCL printer commands
Job control commands
| Function
|
Command
|
Options (#)
|
| Reset
|
ECE
|
n/a
|
| Number of Copies
|
EC&l#X
|
1 to 999
|
| 2-sided/1-sided printing
|
EC&l#S
|
0 = Simplex (1-sided) printing 1 = Duplex (2-sided) with long edge binding 2 = Duplex (2-sided) with short edge binding
|
Page control commands
[1] For custom paper, replace "Custompapertype" with the name of the paper, and replace the "#" with the number of characters in the name, plus 1.
| Function
|
Command
|
Options (#)
|
| Paper Source
|
EC&l#H
|
0 = prints or ejects current page
1 = Tray 2
2 = manual feed, paper
3 = manual feed, envelope
4 = Tray 1
5 = Tray 3
7 = auto select
8 = Tray 4
20-69 = external trays
|
| Paper Size
|
EC&l#A
|
1 = Executive
2 = Letter
3 = Legal
25 = A5
6 = 11 x 17
24 = A6
26 = A4
27 = A3
44 = B6-JIS
45 = B5-JIS
46 = B4-JIS
71 = Postcard (single)
72 = Postcard (double)
80 = Monarch
81 = Commercial 10
90 = DL
91 = International C5
100 = B5
101 = Custom
|
| Paper Type
|
EC&n#
|
5WdBond = Bond
6WdPlain = Plain
6WdColor = Color
7WdLabels = Labels
9WdRecycled = Recycled
11WdLetterhead = Letterhead
10WdCardstock = Cardstock
11WdPrepunched = Prepunched
11WdPreprinted = Preprinted
13WdTransparency = Transparency
#WdCustompapertype = Custom[1]
|
| Orientation
|
EC&l#O
|
0 = Portrait
1 = Landscape
2 = Reverse Portrait
3 = Reverse Landscape
|
| Top Margin
|
EC&l#E
|
# = number of lines
|
| Text Length (bottom margin)
|
EC&l#F
|
# = number of lines from top margin
|
| Left Margin
|
EC&a#L
|
# = column number
|
| Right Margin
|
EC&a#M
|
# = column number from left margin
|
| Horizontal Motion Index
|
EC&k#H
|
1/120-inch increments (compresses print horizontally)
|
| Vertical Motion Index
|
EC&l#C
|
1/48-inch increments (compresses print vertically)
|
| Line Spacing
|
EC&l#D
|
# = lines per inch (1, 2, 3, 4, 5, 6, 12, 16, 24, 48)
|
| Perforation Skip
|
EC&l#L
|
0 = disable
1 = enable
|
Cursor positioning
| Function
|
Command
|
Options (#)
|
| Vertical Position (Rows)
|
EC&a#R
|
# = row number
|
| Vertical Position (Dots)
|
EC*p#Y
|
# = dot number (300 dots = 1 inch)
|
| Vertical Position (Decipoints)
|
EC&a#V
|
# = decipoint number (720 decipoints = 1 inch)
|
| Horizontal Position (Columns)
|
EC&a#C
|
# = column number
|
| Horizontal Position (Dots)
|
EC*p#X
|
# = dot number (300 dots = 1 inch)
|
| Horizontal Position (Decipoints)
|
EC&a#H
|
# = decipoint number (720 decipoints = 1 inch)
|
Programming hints
| Function
|
Command
|
Options (#)
|
| End of Line Wrap
|
EC&s#C
|
0 = Enable
1 = Disable
|
| Display Functions On
|
ECY
|
n/a
|
| Display Functions Off
|
ECZ
|
n/a
|
Language selection
| Function
|
Command
|
Options (#)
|
| Enter PCL Mode
|
EC%#A
|
0 = Use previous PCL cursor position
1 = Use current HP-GL/2 pen position
|
| Enter HP-GL/2 Mode
|
EC%#B
|
0 = Use previous HP-GL/2 pen position
1 = Use current PCL cursor position
|
Font Selection
[1] Order the PCL 5/PJL Technical Reference Documentation Package
for symbol set charts or for more information.
[2] The preferred method is to use the primary pitch command.
| Function
|
Command
|
Options (#)
|
| Symbol Sets[1]
|
EC(#
|
8U = HP Roman-8 Symbol Set
10U = IBM Layout (PC-8) (code page 437) Default Symbol Set
12U = IBM Layout for Europe (PC-850) (code page 850)
8M = Math-8
19U = Windows 3.1 Latin 1
9E = Windows 3.1 Latin 2 (commonly used in Eastern Europe)
5T = Windows 3.1 Latin 5 (commonly used in Turkey)
579L = Wingdings Font
|
| Primary Spacing
|
EC(s#P
|
0 = fixed
1 = proportional
|
| Primary Pitch
|
EC(s#H
|
# = characters/inch
|
| Set Pitch Mode[2]
|
EC&k#S
|
0 = 10
4 = 12 (elite)
2 = 16.5 - 16.7 (compressed)
|
| Primary Height
|
EC(s#V
|
# = points
|
| Primary Style[1]
|
EC(s#S
|
0 = upright (solid)
1 = italic
4 = condensed
5 = condensed italic
|
| Primary Stroke Wt.[1]
|
EC(s#B
|
0 = medium (book or text)
1 = semi bold
3 = bold
4 = extra bold
|
| Typeface[1]
|
EC(s#T
|
Print a PCL font list to view the command for each internal font.
|
|
|