Detailed instructions for use are in the User's Guide.
Part I Click here to access Part II on hp.com.
PCL 5 Printer LanguageTechnical Reference Manual
HP Part No. 5961-0509 Printed in USA First Edition - October 1992
Notice
This document contains proprietary information which is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced, 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.
ii
EN
Printing History
This manual was created using HP Tag/Vectra software on an HP Vectra Personal Computer. The body text is printed in Helvetica fonts. The camera-ready copy was printed on an HP LaserJet IIISi printer with Resolution Enhancement technology (REt) and was then reproduced using standard offset printing. First Edition  October 1992
NOTICE
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 HP PCL 5 Printer Language Technical Reference Manual (p/n 33459-90903). If you have ordered another PCL Technical Reference document, this manual and the PCL 5 Comparison Guide are the updated replacement documents.
EN
iii
Trademark Credits
Intellifont and Garth Graphic are U.S. registered trademarks of Agfa Division, Miles Inc. CG Triumvirate and Shannon are trademarks of Agfa Division, Miles Inc. CG Bodoni, CG Century Schoolbook, CG Goudy Old Style, CG Melliza, Microstyle, CG Omega, CG Palacio, CG Times and CG Trump Mediaeval are products of Agfa Division, Miles Inc. CG Times, a product of Agfa Division, Miles Inc., is based on Times New Roman, a U.S. registered trademark of Monotype Corporation plc. PCL, and Vectra are U.S. registered trademarks of Hewlett-Packard Company. Resolution Enhancement is a trademark of Hewlett-Packard Company. IBM is a registered trademark of International Business Machines Corporation. Microsoft, Windows, and MS-DOS are U.S. registered trademarks of Microsoft Corporation. TrueType and Macintosh are registered trademarks of Apple Computer, Inc. PostScript is a registered trademark of Adobe Systems, Inc. Centronics is a U.S. registered trademark of Centronics Corporation. ITC Avant Garde Gothic, ITC Benguiat, ITC Bookman, ITC Cheltenham, ITC Galliard, ITC Korinna, ITC Lubalin Graph, ITC Souvenir, ITC Zapf Chancery and ITC Zapf Dingbats are U.S. registered trademarks of International Typeface Corporation. ITC Tiffany is a trademark of International Typeface Corporation. Futura is a U.S. registered trademark of Fundicion Tipografica Neufville, S.A. Serifa is a trademark of Fundicion Tipografica Neufville, S.A. Letraset is a registered trademark of Esselte Pendaflex Corporation. Revue and University Roman are trademarks of Esselte Pendaflex Corporation. Helvetica and Times Roman are trademarks of Linotype AG and its subsidiaries. Univers is a U.S. registered trademark of Linotype AG and its subsidiaries. Antique Olive is a trademark of Monsieur Marcel OLIVE. Arial and Gill Sans are registered trademarks of The Monotype Corporation plc.
iv
EN
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 document. 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 document.
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 differences 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.) allow you to embed printer commands as escape sequences in the body of your documents. This manual presents the full syntax and 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.
EN
v
Note
Since actual implementation of printer commands within software applications varies from package to package, specific 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 current versions 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 each chapter is provided below.
Chapter 1 - Introduction to HP PCL
This chapter gives a brief history of the development of the PCL language, describes the PCL language levels (architecture), and describes the PCL command structure (control codes and escape sequences).
Chapter 2 - The Page
This chapter introduces the idea of the logical page and identifies the area in which printing can occur. It also describes the PCL coordinate system and the HP-GL/2 picture frame.
Chapter 3 - The Print Environment
This chapter introduces the printer's feature settings, collectively, as the print environment. It includes descriptions of the factory default environment, user default environment, and the modified print environment. The effect of printer reset functions is also described.
Chapter 4 - PCL 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 specification.
vi
EN
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 font characteristics.
Chapter 8 - PCL Font Selection
This chapter describes how to select a font for printing using the font characteristics commands. The underline feature is described 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-Defined Symbol Sets
This chapter describes the capability of some PCL 5 printers to enable users to define 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.
Chapter 12 - Macros
This chapter describes macro commands which store a block of PCL commands and data which can be used repeatedly without redefining the block. The macro function reduces the number of commands that must be sent to the printer.
EN
vii
Chapter 13 - The PCL Print Model
This chapter describes the PCL print model which allows for special effects when printing.
Chapter 14 - PCL Rectangular Area Fill Graphics
This chapter describes how to define and fill a rectangular area with one of the predefined PCL patterns, or with a user-defined pattern.
Chapter 15 - Raster Graphics
This chapter describes how to download raster graphics to the printer, and includes various techniques for reducing the amount of data needed to define 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-defined patterns.
Chapter 17 - An Introduction to HP-GL/2 Vector 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 location, 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 define and position the picture frame, along with the commands used to enter and exit HP-GL/2 mode.
viii
EN
Chapter 19 - The Configuration 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 about 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 how it is used to draw polygons, subpolygons and circles. The commands for drawing and filling wedges and rectangles are also described in this chapter.
Chapter 22 - The Line and Fill Attributes Group
This chapter describes the commands used to vary the line types and fill patterns used to create HP-GL/2 graphics.
Chapter 23 - The Character Group
This chapter contains information about the commands used to print text (labels) in HP-GL/2 mode. This allows you to print HP-GL/2 labels in almost any size, slant and direction using proportional or fixed-spaced scalable fonts.
Chapter 24 - Programming Hints
This chapter provides programming information for use during the development of PCL software.
EN
ix
Related Documentation
The following related manuals provide further information about HP LaserJet printers, including their features and functions.
PCL 5 Comparison Guide
This document contains supplemental information for programming PCL 5 LaserJet printers. It identifies how different HP PCL 5 LaserJet printers implement the commands described in the HP PCL 5 Printer Language Technical Reference Manual. It provides printer-specific information on feature sets, paper handling, fonts, and the printer's control panel.
Intellifont Scalable Typeface Format
This document provides information for designing scalable fonts using Agfa's Font Access Interchange Standard (FAIS). This document can be obtained from Agfa Division, Miles Inc. by writing to the address below or by phone. Agfa Division, Miles Inc. Typographic Systems OEM Technical Support 90 Industrial Way Wilmington, MA 01887 (508) 658-5600
TrueType Font Files
This document, which provides information for designing scalable fonts using Microsoft Corporation's TrueType font scaling technology has been made available in downloadable form on both CompuServe and Internet. Contact Microsoft Corporation for details.
x
EN
Contents
Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Printing History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Trademark Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v What You Can Learn From This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v Related Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x PCL 5 Comparison Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Intellifont Scalable Typeface Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x TrueType Font Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Introduction to HP PCL
PCL Printer Language Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2 ...