PCL 5 Printer Language
Technical Reference Manual
ABCDE
HP Part No. 5961-0509
Printed in USA
First Edition - October 1992
Notice
HEWLETT-PACKARD MAKES NO WARRANTY OF
ANY KIND WITH REGARD TO THIS MATERIAL,
INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE.
Hewlett-Packard shall not be liable for errors contained
herein or for incidental or consequential damages in
connection with the furnishing, performance, or use of
this material.
This document contains proprietary information whichis
protected by copyright. All rights are reserved. No part
of this do cument may be photo copied, repro duced, or
translated to another language without the prior written
consent of Hewlett-Packard Company. The information
contained in this document is subject to change without
notice.
c
Copyright 1992 Hewlett-Packard Company
Printing History
This document is the current edition of the technical reference manual
for PCL 5 and earlier printers. It replaces the September 1990 edition of
the
33459-90903). If you have ordered another PCL Technical Reference
document, this manual and the
updated replacement do cuments.
This manual was created using
on an HP Vectra Personal Computer. The bo dy text is
printed in
copywas printed on an HP LaserJet IIISi printer with
Resolution Enhancement technology (RET) and was
then repro duced using standard oset printing.
First Edition | October 1992
HP PCL 5 Printer Language Technical Reference Manual
Century Schoolbook
NOTICE
PCL 5 Comparison Guide
HP Tag/Vectra
fonts. The camera-ready
are the
software
(p/n
iii
Trademark Credits
Intellifont
trademarks of Agfa Division, Miles Inc.
and
Shannon
and
Garth Graphic
are U.S. registered
CG Triumvirate
are trademarks of Agfa Division, Miles Inc.
CG Bodoni,CG Century Schoolbook,CG Goudy Old
Style,CG Mel liza,Microstyle,CG Omega,CG Palacio
CG Times
Agfa Division, Miles Inc.
Division, Miles Inc., is based on
and
CG Trump Mediaeval
CG Times
are products of
, a product of Agfa
Times New Roman
,
a U.S. registered trademark of Monotype Corporation
plc.
PCL
, and
Vectra
Hewlett-Packard Company.
a trademark of Hewlett-Packard Company.
are U.S. registered trademarks of
Resolution Enhancement
IBM
is a
is
registered trademark of International Business Machines
Corporation.
Microsoft,Windows
, and
MS-DOS
are
U.S. registered trademarks of Microsoft Corporation.
TrueType
of Apple Computer, Inc.
trademark of Adob e Systems, Inc.
registered trademark of Centronics Corp oration.
and
Macintosh
are registered trademarks
PostScript
is a registered
Centronics
is a U.S.
ITC
Avant Garde Gothic,ITC Benguiat,ITC Bookman,ITC
Cheltenham,ITC Gal liard,ITC Korinna,ITC Lubalin
Graph,ITC Souvenir,ITC Zapf Chancery
Dingbats
Typeface Corporation.
are U.S. registered trademarks of International
ITC Tiany
is a trademark of
International Typeface Corporation.
Futura
and
ITC Zapf
is a U.S.
registered trademark of Fundicion Tipograca Neufville,
S.A.
Serifa
Neufville, S.A.
Esselte Pendaex Corporation.
Roman
Helvetica
AG and its subsidiaries.
trademark of Linotype AG and its subsidiaries.
Olive
Arial
is a trademark of Fundicion Tipograca
Letraset
is a registered trademark of
Revue
and
University
are trademarks of Esselte Pendaex Corporation.
and
Times Roman
are trademarks of Linotype
Univers
is a U.S. registered
Antique
is a trademark of Monsieur Marcel OLIVE.
and
Gill Sans
are registered trademarks of The
Monotype Corporation plc.
,
iv
Inside This Manual
What You Can Learn
From This Manual
Hewlett-Packard has developed a standard set of printer
features for use in all HP printers. Printer features
are accessed through the corresponding commands of
Hewlett-Packard's PCL language. This manual describes
the PCL 5 printer language. This includes descriptions
of the commands available for Hewlett-Packard PCL
5 LaserJet printers and the basic requirements of
PCL language programming. With the release of new
LaserJet family printers there are new features added
which supplement the existing PCL base set. Features of
future printer releases are not covered in this do cument.
The new features are described in the latest version of
the
PCL 5 Comparison Guide
. Programmers should
familiarize themselves with the information provided
in the
PCL 5 Comparison Guide
in addition to the
information in this do cument.
Experienced Users
This manual was written for people with some
programming experience. Many of the concept
discussions assume some programming knowledge.
When writing a PCL language program, you should
know the PCL language concepts and commands
presented in this manual, and should be aware of the
dierences in implementation of the PCL 5 printer
language for the various HP LaserJet printers, as
described in the
PCL 5 Comparison Guide
.
Non-technical Users
Many software applications (word processing software,
spreadsheets, etc.) allowyou to embed printer
commands as
escape sequences
in the bo dy of your
documents. This manual presents the full syntax and
v
explanation of all the commands supported by PCL 5
LaserJet printers. These commands enable you to take
advantage of the LaserJet printer's advanced feature set.
Note
Since actual implementation of printer commands within
software applications varies from package to package,
specic examples are not given. For examples of printer
command usage with many popular software packages,
refer to HP's
Software Application Notes,
provided with
the printer. The most currentversions of software
application notes can be obtained through the HP
Forum on CompuServe, by fax using the HP FIRST fax
service, or through HP's literature distribution. Refer to
Appendix A for more information.
Chapter Summaries
A brief description of eachchapter is provided below.
Chapter 1 - Introduction to HP PCL
This chapter gives a brief history of the development
of the PCL language, describ es the PCL language
levels (architecture), and describes the PCL command
structure (control codes and escap e sequences).
Chapter 2 - The Page
This chapter introduces the idea of the logical page and
identies the area in which printing can o ccur. It also
describes the PCL co ordinate system and the HP-GL/2
picture frame.
Chapter 3 - The Print Environment
This chapter introduces the printer's feature settings,
collectively, as the printenvironment. It includes
descriptions of the factory default environment,
user default environment, and the modied print
environment. The eect of printer reset functions is also
described.
vi
Chapter 4 - Job Control Commands
This chapter describes the commands which provide job
control. Job control commands are usually grouped
together and sent at the beginning of a job. Job control
includes restoration of the User Default Environment,
selection of the number of copies of each page to be
printed, duplex print commands, and unit of measure
specication.
Chapter 5 - Page Control Commands
This chapter describes the commands providing page
format control. Page format control allows you to select
the page source, size, orientation, margins, and text
spacing.
Chapter 6 - Cursor Positioning
This chapter describes how to position the cursor within
the logical page.
Chapter 7 - Fonts
This chapter describes basic font information including
fontcharacteristics.
Chapter 8 - Font Selection
This chapter describes how to select a font for printing
using the fontcharacteristics commands. The underline
feature is describ ed at the end of the chapter.
Chapter 9 - Font Management
This chapter describes font management which provides
mechanisms for downloading and manipulating soft
fonts.
Chapter 10 - User-Dened Symbol Sets
This chapter describes the capability of some PCL 5
printers to enable users to dene their own symbol sets
for special needs.
Chapter 11 - Soft Font Creation
This chapter describes how to organize font/character
data for downloading to the printer.
vii
Chapter 12 - Macros
This chapter describes macro commands which store a
block of PCL commands and data which can b e used
repeatedly without redening the block. The macro
function reduces the number of commands that must be
sent to the printer.
Chapter 13 - The PCL Print Model
This chapter describes the PCL print model which allows
for special eects when printing.
Chapter 14 - PCL Rectangular Area Fill Graphics
This chapter describes how to dene and ll a
rectangular area with one of the predened PCL
patterns, or with a user-dened pattern.
Chapter 15 - Raster Graphics
This chapter describes howtodownload raster graphics
to the printer, and includes various techniques for
reducing the amount of data needed to dene the raster
image.
Chapter 16 - Status Readback
This chapter describes the PCL status readback features.
Status readback enables you to obtain PCL status
information from the printer, such as: available printer
(user) memory, a list of fonts and symbol sets, and the
ID numbers of macros and user-dened patterns.
viii
Chapter 17 - An Introduction to HP-GL/2 Graphics
This chapter introduces basic information for HP-GL/2.
It lists the vector graphics commands, and describes
the HP-GL/2 command syntax. An overview of several
important topics is also provided, such as the PCL
Picture Frame concept, scaling, pen status and lo cation,
and absolute vs. relative pen movement.
Chapter 18 - The Picture Frame
This chapter describes how to set up an area on the page
for printing vector graphics (the PCL Picture Frame). It
discuses the commands necessary to dene and position
the picture frame, along with the commands used to
enter and exit HP-GL/2 mode.
Chapter 19 - The Conguration and Status Group
This chapter describes the commands used to set default
conditions and values for programmable HP-GL/2
features. It also explains the commands used for scaling,
establishing a soft-clip window, and rotating the
HP-GL/2 coordinate system.
Chapter 20 - The Vector Group
This chapter provides information ab out pen movement
and drawing lines, arcs, and circles. It also covers a way
to encode coordinates for increased print speed.
Chapter 21 - The Polygon Group
This chapter explains the polygon mode and howitis
used to draw polygons, subpolygons and circles. The
commands for drawing and lling wedges and rectangles
are also describ ed in this chapter.
Chapter 22 - The Line and Fill Attributes Group
This chapter describes the commands used to vary the
line types and ll patterns used to create HP-GL/2
graphics.
Chapter 23 - The Character Group
This chapter contains information ab out the commands
used to print text (lab els) in HP-GL/2 mode. This
allows you to print HP-GL/2 lab els in almost any size,
slant and direction using proportional or xed-spaced
scalable fonts.
Chapter 24 - Programming Hints
This chapter provides programming information for use
during the development of PCL software.
ix
Related
Documentation
The following related manuals provide further
information about HP LaserJet printers, including their
features and functions.
PCL 5 Comparison
Guide
Intellifont Scalable
Typeface Format
TrueTypeFont Files
This document contains supplemental information for
programming PCL 5 LaserJet printers. It identies how
dierent HP PCL 5 LaserJet printers implement the
commands described in the
Technical Reference Manual
HP PCL 5 Printer Language
. It provides printer-specic
information on feature sets, paper handling, fonts, and
the printer's control panel.
This document provides information for designing
scalable fonts using Agfa's Font Access Interchange
Standard (FAIS). This do cument can be obtained from
Agfa Division, Miles Inc. by writing to the address
beloworby phone.
Agfa Division, Miles Inc.
Typographic Systems
OEM Technical Support
90 Industrial Way
Wilmington, MA 01887
(508) 658-5600
This document, which provides information for designing
scalable fonts using Microsoft Corporation's TrueType
font scaling technology has b een made available in
downloadable form on both CompuServe and Internet.
Contact Microsoft Corporation for details.
x
Contents
1. Introduction to HP PCL
PCL Printer Language History . . . . . 1-1
PCL Printer Language Architecture . . . 1-2
What are Printer Commands? . . . . . 1-3
Control Codes . . . . . . . . . . . 1-3
PCL Commands . . . . . . . . . . 1-3
HP-GL/2 Commands . . . . . . . . 1-4
PJL Commands . . . . . . . . . . 1-4
Syntax of Escape Sequences . . . . . . 1-5
Two-Character Escape Sequences . . . 1-5
Parameterized Escape Sequences . . . 1-6
2. The Page
Introduction . . . . . . . . . . . . . 2-1
Logical Page . . . . . . . . . . . . . 2-2
Printed Dots . . . . . . . . . . . . . 2-3
PCL Coordinate System . . . . . . . . 2-5
Units of the PCL Coordinate System . . 2-6
PCL Units . . . . . . . . . . . . . 2-6
Decipoints . . . . . . . . . . . . . 2-6
Columns & Rows . . . . . . . . . . 2-6
Printer Internal Units . . . . . . . . 2-6
HP-GL/2 Picture Frame . . . . . . . . 2-7
Printable Area . . . . . . . . . . . . 2-8
Contents-1
3. The PrintEnvironment
Introduction . . . . . . . . . . . . . 3-1
Factory Default Environment . . . . . 3-2
User Default Environment. . . . . . . 3-6
Modied PrintEnvironment . . . . . . 3-7
Resetting the PrintEnvironment . . . . 3-8
Printer Reset . . . . . . . . . . . . 3-8
Cold Reset . . . . . . . . . . . . . 3-9
4. PCL Job Control Commands
Introduction . . . . . . . . . . . . . 4-1
Printer Reset Command . . . . . . . . 4-3
Universal Exit Language Command . . . 4-4
Number of Copies Command . . . . . . 4-5
Example . . . . . . . . . . . . . . 4-5
Simplex/Duplex Print Command . . . . 4-7
Left Oset Registration Command . . . 4-10
Top Oset Registration Command . . . 4-12
Duplex Page Side Selection Command . . 4-15
Example . . . . . . . . . . . . . . 4-15
Job Separation Command . . . . . . . 4-16
Output Bin Selection Command . . . . 4-17
Unit of Measure Command . . . . . . 4-18
Contents-2
5. Page Control Commands
Introduction . . . . . . . . . . . . . 5-1
Page Size Command . . . . . . . . . 5-2
Example . . . . . . . . . . . . . . 5-3
Paper Source Command . . . . . . . . 5-4
Example . . . . . . . . . . . . . . 5-5
Logical Page Orientation Command . . . 5-6
Print Direction Command . . . . . . . 5-11
Text Area . . . . . . . . . . . . . . 5-13
Left Margin Command . . . . . . . . 5-15
Example . . . . . . . . . . . . . . 5-15
Right Margin Command . . . . . . . . 5-16
Example . . . . . . . . . . . . . . 5-16
Clear Horizontal Margins Command . . 5-17
Top Margin Command . . . . . . . . 5-18
Example . . . . . . . . . . . . . . 5-19
Text Length Command . . . . . . . . 5-20
Example . . . . . . . . . . . . . . 5-20
Perforation Skip Command . . . . . . 5-21
Horizontal Motion Index (HMI) Command 5-22
Example . . . . . . . . . . . . . . 5-23
Vertical Motion Index (VMI) Command . 5-24
Example . . . . . . . . . . . . . . 5-24
Common VMI Settings . . . . . . . 5-25
Line Spacing Command . . . . . . . . 5-26
Example . . . . . . . . . . . . . . 5-26
6. Cursor Positioning
Introduction . . . . . . . . . . . . . 6-1
Absolute vs. Relative Cursor Positioning 6-2
Cursor Positioning Units . . . . . . . 6-3
PCL Units . . . . . . . . . . . . . 6-3
Decipoints . . . . . . . . . . . . . 6-4
Columns & Rows . . . . . . . . . . 6-4
Horizontal Cursor Positioning (Columns)
Command . . . . . . . . . . . . 6-5
Horizontal Cursor Positioning (Decipoints)
Command . . . . . . . . . . . . 6-6
Horizontal Cursor Positioning (PCL Units)
Command . . . . . . . . . . . . 6-7
Horizontal Cursor Positioning Control
Codes . . . . . . . . . . . . . . 6-8
CR - Carriage Return . . . . . . . . 6-8
SP - Space . . . . . . . . . . . . . 6-8
BS - Backspace . . . . . . . . . . . 6-9
HT - Horizontal Tab . . . . . . . . 6-9
Vertical Cursor Positioning (Rows)
Command . . . . . . . . . . . . 6-10
Vertical Cursor Positioning (Decip oints)
Command . . . . . . . . . . . . 6-11
Vertical Cursor Positioning (PCL Units)
Command . . . . . . . . . . . . 6-12
Contents-3
Half-Line Feed Command . . . . . . . 6-13
Vertical Cursor Positioning Control Codes 6-14
LF - Line Feed . . . . . . . . . . . 6-14
FF - Form Feed . . . . . . . . . . 6-14
Line Termination Command . . . . . . 6-15
Push/Pop Cursor Position Command . . 6-16
7. Fonts
Introduction . . . . . . . . . . . . . 7-1
Font Sources . . . . . . . . . . . . 7-3
Symbol Set . . . . . . . . . . . . . 7-4
Spacing . . . . . . . . . . . . . . . 7-5
Pitch . . . . . . . . . . . . . . . . 7-6
Height . . . . . . . . . . . . . . . 7-7
Style . . . . . . . . . . . . . . . . 7-8
StrokeWeight . . . . . . . . . . . . 7-8
Typeface Family . . . . . . . . . . . 7-9
Orientation . . . . . . . . . . . . . 7-10
Bitmap Fonts and Scalable Typefaces . . 7-11
Internal Fonts . . . . . . . . . . . . 7-13
Special Eects . . . . . . . . . . . . 7-13
8. PCL Font Selection
Introduction . . . . . . . . . . . . . 8-1
Primary and Secondary Fonts . . . . . 8-6
Font Resolution . . . . . . . . . . . 8-6
Symbol Set Command . . . . . . . . . 8-7
Example . . . . . . . . . . . . . . 8-8
7-bit ISO Symbol Sets . . . . . . . . 8-8
Spacing Command . . . . . . . . . . 8-9
Example . . . . . . . . . . . . . . 8-10
Pitch Command . . . . . . . . . . . 8-11
Example . . . . . . . . . . . . . . 8-13
Height Command . . . . . . . . . . . 8-14
Example . . . . . . . . . . . . . . 8-15
Style Command . . . . . . . . . . . 8-16
Example . . . . . . . . . . . . . . 8-17
StrokeWeight Command . . . . . . . 8-19
Contents-4
Example . . . . . . . . . . . . . . 8-21
Typeface Family Command . . . . . . 8-22
Example . . . . . . . . . . . . . . 8-23
Orientation . . . . . . . . . . . . . 8-24
Font Selection Examples . . . . . . . . 8-25
Bitmap, Fixed-Spaced Font . . . . . 8-25
Scalable, Prop ortional-Spaced Font . . 8-26
Summary of Font Selection by
Characteristic . . . . . . . . . . . 8-28
Font Selection by ID Command . . . . 8-31
Examples . . . . . . . . . . . . . 8-32
Select Default Font Command . . . . . 8-33
HP-GL/2 Font Selection . . . . . . . . 8-33
Transparent Print Data Command . . . 8-34
Example . . . . . . . . . . . . . . 8-34
Underline Command . . . . . . . . . 8-35
9. Font Management
Introduction . . . . . . . . . . . . . 9-1
Downloading Soft Fonts . . . . . . . . 9-2
Temporary vs. PermanentFonts . . . . 9-3
Deleting Fonts . . . . . . . . . . . . 9-4
Font ID Command . . . . . . . . . . 9-5
Example . . . . . . . . . . . . . . 9-5
Font Control Command . . . . . . . . 9-6
Examples . . . . . . . . . . . . . 9-6
Font Management Example . . . . . . 9-8
Unbound Scalable Fonts . . . . . . . . 9-9
Bound and Unbound Fonts . . . . . 9-9
Font Selection and Unbound Fonts . . 9-9
Symbol Collections . . . . . . . . 9-10
Character Complement Numbers . . 9-11
Character Requirements Number . . 9-12
Final Font Selection . . . . . . . . 9-13
Symbol Set Mapping Table . . . . 9-13
Printing a Character . . . . . . . 9-15
Contents-5
10. User-Dened Symbol Sets
Introduction . . . . . . . . . . . . . 10-1
Symbol Set ID Code Command . . . . . 10-2
Dene Symbol Set . . . . . . . . . . 10-5
Header Size (UI) . . . . . . . . . . 10-7
Encoded Symbol Set Designator (UI) . 10-7
Format (UB) . . . . . . . . . . . . 10-7
Symbol Set Type (UB) . . . . . . . 10-8
First Code (UI) . . . . . . . . . . 10-8
Last Code (UI) . . . . . . . . . . . 10-8
Character Requirements (Array of UB) 10-9
Symbol Map (Array of UI) . . . . . . 10-12
Symbol Set Control Command . . . . . 10-13
User-Dened Symbol Set Examples . . . 10-14
Unicode Symbol Index Example . . . 10-14
MSL Symbol Index Example . . . . . 10-15
11. Soft Font Creation
Introduction . . . . . . . . . . . . . 11-1
Font Classications . . . . . . . . . 11-2
Coordinate System . . . . . . . . . . 11-4
Bitmap Fonts . . . . . . . . . . . 11-4
Intellifont Scalable Fonts . . . . . . 11-5
TrueType Scalable Fonts . . . . . . 11-5
Font Header Command . . . . . . . . 11-6
Font Header Format . . . . . . . . . 11-7
Data Types . . . . . . . . . . . . 11-17
Font Descriptor Size (UI) . . . . . . 11-17
Header Format (UB) . . . . . . . . 11-17
FontType (UB) . . . . . . . . . . 11-18
Style MSB (UI) . . . . . . . . . . 11-19
Baseline Position (UI) . . . . . . . . 11-21
Cell Width (UI) . . . . . . . . . . 11-21
Cell Height (UI) . . . . . . . . . . 11-21
Orientation (UB) . . . . . . . . . . 11-23
Spacing (B) . . . . . . . . . . . . 11-23
Symbol Set (UI) . . . . . . . . . . 11-24
Pitch (UI) . . . . . . . . . . . . . 11-25
Contents-6
Height (UI) . . . . . . . . . . . . 11-25
xHeight (UI) . . . . . . . . . . . . 11-26
Width Type (SB) . . . . . . . . . . 11-26
Style LSB (UB) . . . . . . . . . . 11-27
StrokeWeight (SB) . . . . . . . . . 11-27
Typeface (UB) . . . . . . . . . . . 11-28
Current Usage . . . . . . . . . . 11-28
Vendor Number - Bits 15 - 12 . . 11-28
Typeface Family Number - Bits 11 -
0 . . . . . . . . . . . . . 11-29
Example . . . . . . . . . . . . 11-29
Previous Usage . . . . . . . . . . 11-29
Vendor-Version . . . . . . . . . 11-30
Typeface Base Value . . . . . . 11-30
Serif Style (UB) . . . . . . . . . . 11-31
Quality (UB) . . . . . . . . . . . . 11-32
Placement (SB) . . . . . . . . . . 11-32
Underline Position (Distance) (SB) . . 11-32
Underline Thickness (UB) . . . . . . 11-33
Text Height (UI) . . . . . . . . . . 11-33
Text Width (UI) . . . . . . . . . . 11-33
First Code (UI) . . . . . . . . . . 11-33
Last Code / Number of Characters (UI) 11-34
Pitch Extended (UB) . . . . . . . . 11-34
Height Extended (UB) . . . . . . . 11-35
Cap Height (UI) . . . . . . . . . . 11-35
Font Number (ULI) . . . . . . . . . 11-36
Font Name (ASC16) . . . . . . . . 11-37
X Resolution (UI) . . . . . . . . . 11-38
Y Resolution (UI) . . . . . . . . . 11-38
Scale Factor (UI) . . . . . . . . . . 11-38
Master Underline Position (SI) . . . . 11-38
Master Underline Thickness (Height)
(UI) . . . . . . . . . . . . . . 11-38
Font Scaling Technology (UB) . . . . 11-39
Variety (UB) . . . . . . . . . . . . 11-39
OR Threshold (UI) . . . . . . . . . 11-39
Global Italic Angle (SI) . . . . . . . 11-39
Contents-7
Global Intellifont Data Size (UI) . . . 11-39
Global Intellifont Data . . . . . . . 11-39
Character Complement (Array of UB) . 11-40
Checksum . . . . . . . . . . . . . 11-43
Copyright . . . . . . . . . . . . . 11-44
Segmented Font Data (Format 15) . . 11-45
Segment Identier (UI) . . . . . . 11-46
Segment Size (UI) . . . . . . . . 11-46
Formats of Data Segments . . . . . 11-46
AP (Application Support Segment) 11-46
CC (Character Complement) . . . 11-46
CP, copyright . . . . . . . . . 11-46
GI (Global Intellifont Data) . . . 11-47
GT (Global TrueType Data) . . . 11-47
IF (IntellifontFace Data) . . . . 11-47
PA (PANOSE Description) . . . 11-47
PF (PS-Compatible Font Name) . 11-48
XW (x-windows font name) . . . 11-48
Checksum . . . . . . . . . . . . 11-48
Font Header Examples . . . . . . . . 11-49
Bitmap Example . . . . . . . . . . 11-49
Intellifont Scalable Example . . . . . 11-51
Character Denitions . . . . . . . . . 11-53
Character Code Command . . . . . . . 11-54
Character Denition Command . . . . . 11-55
Character Descriptor Formats . . . . . 11-56
Character Descriptor and Data Format
for PCL Bitmap Fonts . . . . . . 11-57
Format (UB) . . . . . . . . . . . 11-58
Continuation (B) . . . . . . . . . 11-58
Descriptor Size (UB) . . . . . . . 11-58
Class (UB) . . . . . . . . . . . 11-58
Class 1 - Bitmap Data . . . . . . 11-59
Class 2 - Compressed Bitmap Data . 11-59
Orientation (UB) . . . . . . . . . 11-61
Left Oset (SI) . . . . . . . . . . 11-61
Top Oset (SI) . . . . . . . . . . 11-61
Character Width (UI) . . . . . . . 11-62
Contents-8
Character Height (UI) . . . . . . . 11-62
Delta X (SI) . . . . . . . . . . . 11-62
Character Data . . . . . . . . . . 11-62
Character Descriptor and Data Format
for Intellifont Scalable Fonts . . . 11-63
Format (UB) . . . . . . . . . . . 11-66
Continuation (B) . . . . . . . . . 11-66
Descriptor Size (UB) . . . . . . . 11-66
Class (UB) . . . . . . . . . . . 11-67
Class 3 -Intellifont Scalable Character
Contour Data . . . . . . . . . 11-67
Class 4 - Intellifont Scalable
Compound Character Data . . . 11-67
Contour Data Size (UI) . . . . . . 11-68
Metric Data Oset (SI) . . . . . . 11-68
Character Intellifont Data Oset (SI) 11-68
Contour Tree Oset (SI) . . . . . . 11-68
XY Data Oset (SI) . . . . . . . 11-68
Metric Data . . . . . . . . . . . 11-68
Character Intellifont Scalable Data . 11-69
Contour Tree Data . . . . . . . . 11-69
XY Coordinate Data . . . . . . . 11-69
Checksum . . . . . . . . . . . . 11-69
Compound Character Escapement (SI) 11-69
Number of Comp onents (UB) . . . 11-69
Component List . . . . . . . . . 11-70
Character Descriptor and Data Format
for TrueType Fonts . . . . . . . 11-71
Format (UB) . . . . . . . . . . . 11-72
Continuation (B) . . . . . . . . . 11-73
Descriptor Size (UB) . . . . . . . 11-73
Class (UB) . . . . . . . . . . . 11-74
Character Data Size (UI) . . . . . 11-75
Glyph ID (UI) . . . . . . . . . . 11-76
TrueType Glyph Data . . . . . . . 11-76
Checksum (UB) . . . . . . . . . 11-76
Character Denition Examples . . . . . 11-77
Bitmap Portrait Character Example . 11-77
Contents-9
Bitmap Landscape Character Example 11-79
12. Macros
Introduction . . . . . . . . . . . . . 12-1
Macro Creation . . . . . . . . . . . 12-3
Macro Invocation . . . . . . . . . . . 12-5
Temporary / Permanent Macros . . . . 12-7
Deleting Macros . . . . . . . . . . . 12-7
Macro ID . . . . . . . . . . . . . . 12-8
Example . . . . . . . . . . . . . . 12-8
Macro Control . . . . . . . . . . . . 12-9
Example . . . . . . . . . . . . . . 12-11
Macro Control Example . . . . . . . . 12-12
13. The PCL Print Mo del
Introduction . . . . . . . . . . . . . 13-1
Command Sequence . . . . . . . . . . 13-6
Source Transparency Mo de Command . . 13-7
Pattern Transparency Mode Command . 13-8
Pattern ID (Area Fill ID) Command . . 13-9
Select Current Pattern Command . . . . 13-13
User-Dened Pattern Graphics . . . . . 13-14
User-Dened Pattern Implementation . 13-14
Pattern Reference Point. . . . . . 13-16
User-Dened Pattern Command . . . . 13-18
Format (Byte 0) . . . . . . . . . . 13-21
Continuation (Byte 1) . . . . . . . . 13-21
Pixel Encoding (Byte 2) . . . . . . . 13-21
Reserved (Byte 3) . . . . . . . . . 13-21
Height in Pixels (Bytes 4 and 5) . . . 13-21
Width in Pixels (Bytes 6 and 7) . . . 13-21
Pattern Image . . . . . . . . . . . 13-21
Master X Resolution (UI) . . . . . . 13-21
Master Y Resolution (UI) . . . . . . 13-21
User-dened Pattern Example . . . . 13-22
Set Pattern Reference Point Command . 13-25
Pattern Control Command . . . . . . . 13-26
Contents-10
14. PCL Rectangular Area Fill Graphics
Introduction . . . . . . . . . . . . . 14-1
Rectangular Area Fill Procedure . . . 14-2
Horizontal Rectangle Size (Decip oints)
Command . . . . . . . . . . . . 14-3
Horizontal Rectangle Size (PCL Units)
Command . . . . . . . . . . . . 14-4
Vertical Rectangle Size (Decip oints)
Command . . . . . . . . . . . . 14-5
Vertical Rectangle Size (PCL Units)
Command . . . . . . . . . . . . 14-6
Pattern ID (Area Fill ID) Command . . 14-7
Fill Rectangular Area Command . . . . 14-11
Pattern Transparency for Rectangular Area
Fill . . . . . . . . . . . . . . . 14-14
Rectangular Area Fill Examples . . . . 14-16
Pre-dened Pattern Examples . . . . 14-16
Solid Fill (Black/White) . . . . . . 14-16
Shaded Fill . . . . . . . . . . . 14-18
Cross-hatch Fill . . . . . . . . . 14-20
User-dened Pattern Example . . . . 14-22
15. Raster Graphics
Introduction . . . . . . . . . . . . . 15-1
Raster Graphics Command Sequence . . 15-4
Raster Graphics Resolution Command . 15-6
Raster Graphics Presentation Mo de
Command . . . . . . . . . . . . 15-9
Raster Height Command . . . . . . . 15-12
Raster Width Command . . . . . . . . 15-15
Start Raster Graphics Command . . . . 15-17
Raster Y Oset Command . . . . . . . 15-19
Set Compression Metho d Command . . . 15-20
Unencoded (Metho d 0) . . . . . . . 15-20
Run-length Encoding (Method 1) . . . 15-21
Tagged Image File Format Enco ding
(Method 2) . . . . . . . . . . . 15-21
Contents-11
Examples: Run-length and TIFF
Compression . . . . . . . . . 15-25
Delta Row Compression (Metho d 3) . 15-26
Adaptive Compression (Method 5) . . 15-31
Adaptive Compression Operation
Hints . . . . . . . . . . . . 15-34
Transfer Raster Data Command . . . . 15-36
End Raster Graphics Command . . . . 15-38
Raster Graphics Example . . . . . . . 15-39
16. Status Readback
Introduction . . . . . . . . . . . . . 16-1
Memory Status Request . . . . . . . 16-2
Entity Status . . . . . . . . . . . 16-3
Status Response . . . . . . . . . . 16-5
Status Response Syntax . . . . . . . . 16-6
Set Status Readback Lo cation Type
Command . . . . . . . . . . . . 16-9
Set Status Readback Lo cation Unit
Command . . . . . . . . . . . . 16-10
Inquire Status ReadbackEntity Command 16-12
Entity Status Responses . . . . . . . . 16-12
Font Response . . . . . . . . . . . 16-13
Bitmap Fonts . . . . . . . . . . 16-14
Scalable Fonts . . . . . . . . . . 16-16
Unbound Scalable Fonts . . . . . . 16-16
Soft Fonts . . . . . . . . . . . . 16-17
Location Type 1 (Currently Selected)
Font... .. .. . .. .. . 16-17
Font Extended Response . . . . . . 16-19
Macro Response . . . . . . . . . . 16-21
User-Dened Pattern Response . . . . 16-22
Symbol Set Response . . . . . . . . 16-23
Entity Error Codes . . . . . . . . . . 16-24
. . . . . . . . . . . . . . . . . 16-24
ERROR=INVALID ENTITY . . . 16-24
ERROR=INVALID LOCATION . . 16-24
ERROR=NONE . . . . . . . . . 16-25
Contents-12
ERROR=INTERNAL ERROR . . . 16-25
Free Space Command . . . . . . . . . 16-26
Memory Status Response . . . . . . 16-28
Memory Error Resp onse . . . . . . . 16-29
Flush All Pages Command . . . . . . . 16-30
Echo Command . . . . . . . . . . . 16-32
Echo Response . . . . . . . . . . . 16-33
Status Readback Programming Hints . . 16-34
17. An Introduction to HP-GL/2 Graphics
Learning HP-GL/2 . . . . . . . . . . 17-2
HP-GL/2 Commands and Syntax . . . . 17-4
Understanding HP-GL/2 Syntax . . . 17-8
Notations Used to Express Syntax . . 17-10
Mnemonic . . . . . . . . . . . . 17-10
parameters . . . . . . . . . . . . 17-10
[] . . . . . . . . . . . . . . . 17-10
[param1,param2 . . . [,param1,param2]] 17-10
params . . . params . . . . . . . . 17-10
text . . . text . . . . . . . . . . . 17-10
(.... ) . . . . . . . . . . . . . . 17-10
; . . . . . . . . . . . . . . . . 17-11
, . . . . . . . . . . . . . . . . 17-11
Omitting Optional Parameters . . . . 17-12
Parameter Formats . . . . . . . . . 17-13
Using HP-GL/2 With Programming
Languages . . . . . . . . . . . . 17-16
Example: BASIC . . . . . . . . . . 17-16
Example: C Programming Language . 17-17
The HP-GL/2 Co ordinate System . . . 17-18
HP-GL/2 & PCL Orientation Interactions 17-21
The Vector Graphics Limits . . . . . . 17-23
HP-GL/2 Units of Measure . . . . . . 17-25
Plotter Units . . . . . . . . . . . . 17-25
User-units . . . . . . . . . . . . . 17-25
Pen Status and Location . . . . . . . 17-26
Pen Status . . . . . . . . . . . . . 17-26
Pen Location . . . . . . . . . . . . 17-28
Contents-13
Scaling . . . . . . . . . . . . . . . 17-29
Absolute and RelativePen Movement. . 17-31
18. The Picture Frame
Introduction . . . . . . . . . . . . . 18-1
Dening the Image Area (PCL Picture
Frame) . . . . . . . . . . . . . . 18-2
Automatically Adjusting Image Size to Fit
the PCL Picture Frame . . . . . . 18-3
Creating a Page Size-Independent Plot 18-3
Typical HP-GL/2 Plot Command Sequence 18-5
Example: Creating and Using a PCL
Picture Frame . . . . . . . . . . 18-7
Horizontal Picture Frame Size (decipoints) 18-10
Example: . . . . . . . . . . . . . 18-10
Vertical Picture Frame Size (Decip oints) . 18-11
Example:To specify a vertical picture
frame size of 6.5 inches, send: . . . 18-11
Set Picture Frame Anchor Point . . . . 18-12
Example: . . . . . . . . . . . . . 18-13
HP-GL/2 Plot Horizontal Size . . . . . 18-14
Example: . . . . . . . . . . . . . 18-14
HP-GL/2 Plot Vertical Size . . . . . . 18-15
Example: . . . . . . . . . . . . . 18-15
Enter HP-GL/2 Mo de . . . . . . . . . 18-16
Example: . . . . . . . . . . . . . 18-17
Enter PCL Mode . . . . . . . . . . . 18-17
Example: . . . . . . . . . . . . . 18-18
Default Settings . . . . . . . . . . . 18-18
Example: Creating a Simple Drawing . 18-21
Contents-14
19. The Conguration and Status Group
Introduction . . . . . . . . . . . . . 19-1
Establishing Default Conditions . . . . 19-3
The Scaling Points P1 and P2 . . . . . 19-4
Using the Scale Command . . . . . . . 19-5
Using Scaling Eectively . . . . . . . . 19-9
Enlarging or Reducing a Picture . . . 19-9
Drawing Equal-Size Pictures on a Page 19-11
Creating Mirror-Images . . . . . . . 19-14
Adapting the HP-GL/2 Coordinate
System to Match the PCL System . 19-17
Windowing: Setting Up Soft-Clip Limits 19-20
CO, Comment . . . . . . . . . . . . 19-21
DF, Default Values . . . . . . . . . . 19-21
IN, Initialize . . . . . . . . . . . . . 19-24
IP, Input P1 and P2 . . . . . . . . . 19-26
IR, Input Relative P1 and P2 . . . . . 19-29
IW, Input Window . . . . . . . . . . 19-33
PG, Advance Full Page . . . . . . . . 19-37
RO, Rotate Coordinate System . . . . . 19-38
RP, Replot . . . . . . . . . . . . . . 19-44
SC, Scale . . . . . . . . . . . . . . 19-45
For Scaling Types 0 and 1: . . . . . . 19-47
For Scaling Type 2: . . . . . . . . . 19-52
20. The Vector Group
Introduction . . . . . . . . . . . . . 20-1
Drawing Lines . . . . . . . . . . . . 20-3
Drawing Circles . . . . . . . . . . . 20-5
Drawing Arcs . . . . . . . . . . . . 20-6
Drawing Bezier Curves . . . . . . . . 20-9
AA, Arc Absolute . . . . . . . . . . 20-11
AR, Arc Relative. . . . . . . . . . . 20-16
AT, Absolute Arc Three Point . . . . . 20-19
BR, Bezier Relative. . . . . . . . . . 20-24
BZ, Bezier Absolute . . . . . . . . . . 20-27
CI, Circle . . . . . . . . . . . . . . 20-31
PA, Plot Absolute . . . . . . . . . . 20-37
PD, Pen Down . . . . . . . . . . . . 20-39
PE, Polyline Encoded . . . . . . . . . 20-41
Encoding PE Flag Values and X,Y
Coordinates . . . . . . . . . . . 20-45
Programming Considerations . . . . . 20-49
PR, Plot Relative. . . . . . . . . . . 20-52
PU, Pen Up . . . . . . . . . . . . . 20-54
Contents-15
RT, Relative Arc Three Point . . . . . 20-56
21. The Polygon Group
Introduction . . . . . . . . . . . . . 21-1
Using the Polygon Buer . . . . . . . 21-3
Drawing Rectangles . . . . . . . . . . 21-4
Drawing Wedges . . . . . . . . . . . 21-7
Drawing Polygons . . . . . . . . . . 21-12
Drawing Subpolygons . . . . . . . . 21-13
Filling Polygons . . . . . . . . . . 21-15
Even/Odd Fill Metho d . . . . . . 21-15
Non-Zero Winding Fill Metho d . . . 21-16
Drawing Circles in Polygon Mode . . 21-17
Counting the Points in a Polygon . . . 21-18
Counting the Points in a Circle or Arc 21-19
EA, Edge Rectangle Absolute . . . . . 21-20
EP, Edge Polygon . . . . . . . . . . 21-24
ER, Edge Rectangle Relative. . . . . . 21-27
EW, Edge Wedge . . . . . . . . . . . 21-31
FP, Fill Polygon . . . . . . . . . . . 21-36
PM, Polygon Mode Command . . . . . 21-40
(PM0) or (PM) . . . . . . . . . . . 21-41
(PM1) . . . . . . . . . . . . . . 21-43
(PM2) . . . . . . . . . . . . . . 21-43
RA, Fill Rectangle Absolute . . . . . . 21-45
RR, Fill Rectangle Relative . . . . . . 21-49
WG, Fill Wedge . . . . . . . . . . . 21-54
Contents-16
22. The Line and Fill Attributes Group
Introduction . . . . . . . . . . . . . 22-1
Using Line Attributes and Types . . . . 22-3
Using Fill Types . . . . . . . . . . . 22-5
Selecting a \Pen" and Changing Line
Width . . . . . . . . . . . . . . 22-7
AC, Anchor Corner . . . . . . . . . . 22-8
FT, Fill Type . . . . . . . . . . . . 22-11
LA, Line Attributes . . . . . . . . . . 22-21
Line Ends . . . . . . . . . . . . . 22-23
Line Joins . . . . . . . . . . . . . 22-24
Miter Limit . . . . . . . . . . . . 22-26
LT, Line Type . . . . . . . . . . . . 22-30
PW, Pen Width . . . . . . . . . . . 22-38
RF, Raster Fill Denition . . . . . . . 22-42
SM, Symbol Mode . . . . . . . . . . 22-45
SP, Select Pen . . . . . . . . . . . . 22-49
SV, Screened Vectors . . . . . . . . . 22-51
TR, Transparency Mo de . . . . . . . . 22-55
UL, User-Dened Line Type . . . . . . 22-57
WU, Pen Width Unit Selection . . . . . 22-60
23. The Character Group
Introduction . . . . . . . . . . . . . 23-1
Printing Lab els . . . . . . . . . . . . 23-4
Moving to the Carriage Return Point . 23-6
Control Codes . . . . . . . . . . . 23-8
Default Label Conditions . . . . . . . 23-9
Enhancing Labels . . . . . . . . . . . 23-10
Character Size and Slant . . . . . . 23-10
Character Spaces and Text Lines . . . 23-11
Label Orientation and Placement . . . 23-12
Terminating Labels . . . . . . . . . 23-14
Working with the Character Cell . . . . 23-15
Using Fonts . . . . . . . . . . . . . 23-19
Printing with Fixed-Spaced and
Proportional Fonts . . . . . . . . 23-20
Designating and Selecting Fonts . . . . 23-22
Standard and Alternate Fonts . . . . 23-22
AD, Alternate Font Denition . . . . . 23-23
CF, Character Fill Mode . . . . . . . 23-26
CP, Character Plot . . . . . . . . . . 23-30
DI, Absolute Direction . . . . . . . . 23-35
DR, Relative Direction . . . . . . . . 23-45
Example: Using the DR Command . . 23-51
DT, Dene Lab el Terminator . . . . . 23-54
DV, Dene Variable Text Path . . . . . 23-56
Example: Using the DV Command . . 23-60
Contents-17
ES, Extra Space . . . . . . . . . . . 23-62
FI, Select Primary Font . . . . . . . . 23-65
Example: Using the FI Command . . 23-66
FN, Select Secondary Font. . . . . . . 23-68
Example: Using the FN Command . . 23-69
LB, Label . . . . . . . . . . . . . . 23-71
LO, Label Origin . . . . . . . . . . . 23-75
SA, Select Alternate Font . . . . . . . 23-80
SB, Scalable or Bitmap Fonts . . . . . 23-81
SD, Standard Font Denition . . . . . 23-83
Kind 1: Symbol Set . . . . . . . . . 23-84
Kind 2: Font Spacing . . . . . . . . 23-85
Kind 3: Pitch . . . . . . . . . . . 23-85
Kind 4: Height. . . . . . . . . . . 23-86
Kind 5: Posture . . . . . . . . . . 23-86
Kind 6: Stroke Weight . . . . . . . 23-87
Kind 7: Typeface . . . . . . . . . . 23-88
Example: Using the SD Command . . 23-88
SI, Absolute Character Size . . . . . . 23-90
Example: Using the SI Command . . 23-91
SL, Character Slant. . . . . . . . . . 23-95
Example: Using the SL Command . . 23-97
SR, Relative Character Size . . . . . . 23-99
Example: Using the SR Command . . 23-102
SS, Select Standard Font . . . . . . . 23-104
TD, Transparent Data . . . . . . . . 23-105
Contents-18
24. Programming Hints
Introduction . . . . . . . . . . . . . 24-1
PCL Command Parsing . . . . . . . . 24-2
Job Control . . . . . . . . . . . . . 24-3
Printer Reset . . . . . . . . . . . . 24-3
PCL Page Control . . . . . . . . . . 24-4
Paper Source . . . . . . . . . . . . 24-4
Page Size . . . . . . . . . . . . . 24-4
Text Area/Margins . . . . . . . . . 24-4
HMI . . . . . . . . . . . . . . . 24-4
PCL Cursor Positioning . . . . . . . . 24-5
Fonts . . . . . . . . . . . . . . . . 24-6
PCL Raster Graphics . . . . . . . . . 24-8
Macros . . . . . . . . . . . . . . . 24-9
HP-GL/2 Vector Graphics . . . . . . . 24-10
Performance . . . . . . . . . . . . . 24-11
PCL Commands . . . . . . . . . . 24-11
Print Data . . . . . . . . . . . . . 24-11
Print Overrun . . . . . . . . . . . 24-11
Page Protection . . . . . . . . . . 24-12
I/O . . . . . . . . . . . . . . . . 24-12
Troubleshooting Commands . . . . . . 24-13
End-of-Line Wrap . . . . . . . . . 24-13
Example . . . . . . . . . . . . . . 24-13
Display Functions Mo de . . . . . . . 24-14
Example . . . . . . . . . . . . . . 24-15
Auto Continue Mode . . . . . . . . 24-15
Common Errors . . . . . . . . . . . 24-16
20 ERROR . . . . . . . . . . . . 24-16
21 ERROR . . . . . . . . . . . . 24-16
22 ERROR . . . . . . . . . . . . 24-16
40 ERROR . . . . . . . . . . . . 24-17
A. Customer Support
. . . . . . . . . . . . . . . . . . A-1
Help From Your Organization . . . . A-1
Help From Your Dealer . . . . . . . A-1
Help from HP . . . . . . . . . . . A-2
The CompuServeHPForum . . . . A-2
HP Distribution . . . . . . . . . A-2
HP FIRST Faxback support . . . . A-2
HP's Personal Peripherals Assist Line A-3
Glossary
Index
Contents-19
Introduction to HP PCL
1
PCL Printer
Language History
Hewlett-Packard created the PCL printer language
(simply referred to as \PCL" elsewhere in this
manual) to provide an economical and ecientway
for application programs to control a range of printer
features across a number of printing devices. HP has
evolved b oth the denition and implementations of
PCL to provide the optimal price and performance
balance. PCL 5 represents a new breakthrough in
price/performance leadership. Its features were selected
in direct resp onse to customer requests. HP will continue
to lead enhancements to the PCL printer language to
deliver powerful technology advances.
PCL commands are compact escape sequence co des
that are embedded in the print job data stream. This
approach minimizes both data transmission and
command decoding overhead. HP PCL formatters and
fonts are designed to quickly translate application output
into high-quality, device-specic, raster print images.
PCL printer language commonality from HP printer
to HP printer helps to minimize printer support
problems and protect HP printer customer investmentin
applications and printer driver software.
Introduction to HP PCL
PCL PRINTER LANGUAGE HISTORY
1-1