Detailed instructions for use are in the User's Guide.
Printer Job Language Technical Reference Manual
Copyright and License
© 2003 Hewlett-Packard Development Company, LP All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under the copyright laws.
Trademarks
Adobe, PostScript, and the PostScript logo are trademarks of Adobe Systems Incorporated, which may be registered in certain jurisdictions. AppleTalk is a registered trademark of Apple Computer, Inc. Centronics is a U.S. registered trademark of Centronics Data Computer Corporation. HP Explorer Software is a trademark and PCL and Resolution Enhancement are registered trademarks of Hewlett-Packard Company. Epson is a registered trademark of Epson America, Inc. Harvard Graphics is a registered trademark of Software Publishing Corporation. IBM is a registered trademark and ProPrinter is a trademark of International Business Machines Corporation. Lotus and 1-2-3 are registered trademarks of Lotus Development Corporation. Microsoft is a registered trademark and Word, Windows, MS-Mincho, and MSGothic are trademarks of Microsoft Corporation. ESC/P is a trademark of Seiko-Epson Corporation. WordPerfect is a registered trademark of Corel Corporation or Corel Corporation Limited.
The information contained in this document is subject to change without notice.
Publication Number: 5021-0380 Edition 12, 6/2003
Inside This Manual
What You Can Learn From This Manual
Printer Job Language (PJL) was developed by Hewlett-Packard to provide a method for switching printer languages at the job level, and for status readback between the printer and the host computer. PJL offers application programs an efficient way to remotely control Hewlett-Packard printers. Using PJL, developers can provide applications with the ability to programmatically switch printer languages, monitor printer status, request the printer model and configuration, change control panel default settings, modify control panel messages, and more. This manual is written for experienced users such as application developers and technical support personnel. Before using PJL commands, programmers should be familiar with the introductory information in Chapters 1, 2, and 3, and with the programming tips in Chapter 11. In addition, users of this manual should be acquainted with the HP LaserJet printer language (PCL) and with LaserJet printer features.
Application Developers
This PJL Technical Reference Manual provides developers with all the information necessary to add PJL to their applications. Examples are used throughout the manual to help developers write efficient and properly functioning code.
Technical Support Personnel
This manual provides reference information for network administrators and other technical support personnel who manage multi-user systems. PJL provides the potential for significantly enhancing network printer operation.
Non-Technical Users
Non-technical users can use the features of PJL by using HP Explorer Software, or by using software that supports PJL. Since improperly used PJL commands can cause problems in a network situation, inexperienced users are advised against using PJL commands on any system other than a dedicated workstation.
EN
iii
Manual Organization
This manual is comprised of eleven chapters and four appendices. The first three chapters introduce you to the range of PJL features, PJL syntax and format, some rules about using PJL, and a brief description of each command. Chapter 4 explores the essential "kernel" commands--those commands that are part of almost every PJL job. Chapters 5 through 10 each describe a separate group of related commands. The remaining chapters cover programming tips and related PJL information. A brief description of each chapter is provided below.
Chapter 1. Introduction to PJL
This chapter explains what PJL is, who should use PJL, and the benefits of using PJL in application programs. It also covers compatibility with non-PJL printers, which includes older models of HP LaserJet printers, HP DeskJet printers, and HP DesignJet plotters and printers.
Chapter 2. PJL Command Syntax and Format
Chapter 2 explains the conventions used to describe PJL command syntax. The chapter also explains the formats that PJL commands follow and describes what happens when the printer receives an illegal command.
Chapter 3. Using PJL
This chapter explains how PJL commands are used, including the requirements of a PJL job and examples showing basic PJL command structure. In addition, the chapter categorizes the PJL commands in this manual by their functionality, along with a brief command summary.
Chapter 4. Kernel Commands
This chapter explains the three core commands used in most PJL jobs: the Universal Exit Language (UEL) command, the COMMENT command, and the ENTER command. The chapter also describes the related topics of implicit and explicit printer language switching.
iv
EN
Chapter 5. Job Separation Commands
Chapter 5 describes the JOB and EOJ commands, which are used in combination to define job boundaries and provide job-related feedback, such as job completion.
Chapter 6. Environment Commands
This chapter explains setting the printer to a known state. The DEFAULT, INITIALIZE, RESET, and SET commands are explained here.
Chapter 7. Status Readback Commands
Chapter 7 describes status readback, the format of status readback responses, using software tools to interpret status readback, and the commands associated with status readback (INQUIRE, DINQUIRE, ECHO, INFO, USTATUS, and USTATUSOFF). This chapter also covers the processes involved in job recovery and monitoring the printer control panel.
Chapter 8. Device Attendance Commands
Chapter 8 describes the commands used to display messages on the printer control panel: the RDYMSG, OPMSG, and STMSG commands.
Chapter 9. PJL File System Commands
Chapter 9 describes the commands used for managing a printerbased disk drive, or other printer-based mass storage. The commands include FSAPPEND, FSDIRLIST, FSINIT, FSMKDIR, FSQUERY, FSUPLOAD, FSDOWNLOAD, and FSDELETE. These commands provide the capability to initialize the mass storage, make directories, list directories, and download, upload, delete, and append files.
Chapter 10. Job Management
Chapter 10 describes the job management features found on the HP LaserJet 8100 and 8500 printers.
EN
v
Chapter 11. Programming Tips for Using PJL
This chapter demonstrates how to create well-formed jobs and discusses common problems and things to watch for when using PJL commands. Samples are included to demonstrate different types of applications.
Appendix A. Product-Specific Feature Support
This chapter lists all of the PJL commands and shows which commands are supported by the different PJL printers. It also shows which environment variables are supported, and includes printerspecific information about several PJL printers.
Appendix B. PJL Command Summary
This appendix lists all of the PJL commands in alphabetical order, and shows the format of each command.
Appendix C. Programming Examples
Appendix C shows an example of a PJL job in both the generic format used in the rest of this manual, and in the C programming language. The appendix also includes a batch file that modifies the control panel display message during job processing.
Appendix D. PJL Status Codes
This appendix describes the status code information available when using status readback.
Index
This manual includes an index for easy access to PJL information.
vi
EN
Related Documents
The following documents provide related information about Hewlett-Packard PCL 5 printers.
PCL 5 Printer Language Technical Reference Manual
The PCL 5 Printer Language Technical Reference Manual provides a description of the printer command language that controls PCL 5 printers. The manual provides explanations of each PCL command, and examples demonstrating how the commands are used to control the printer. A large portion of the manual is devoted to HP-GL/2, the vector-based graphics language that is part of all PCL 5 printers.
PCL 5 Comparison Guide
This document provides printer-specific information on paper handling, internal fonts, PCL command support, and control panel information. It identifies feature differences between the PCL 5 printers, and how the printers implement the commands described in the PCL 5 Printer Language Technical Reference Manual.
PCL/PJL Technical Quick Reference Guide
This booklet is designed to provide quick access to the syntax of each PCL and PJL command. The commands are grouped by their function so that those familiar with PCL and/or PJL can find the syntax of a specific command without opening the manual.
EN
vii
Manual Conventions
This manual uses the following conventions: · Items in italics indicate names of variables. · Items in UPPERCASE letters indicate PJL command names and words you type verbatim. PJL command names referred to in text are also in uppercase. · Items in square brackets [ ] indicate optional parameters. The brackets themselves are not typed. · Items in brackets < > indicate a control code character (for example, for carriage return) or a special defined identifier. · A vertical bar (|) indicates there is more than one optional parameter. Note Throughout this manual, the term printer also includes any relevant DesignJet plotters and printers.
viii
EN
Contents
Printer Job Language Technical Reference Manual
Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-iii Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-iv Related Documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-vii Manual Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-viii
Contents 1 Introduction to PJL
The Benefits of PJL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Who Should Use PJL? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Compatibility With Non-PJL Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
2 PJL Command Syntax and Format
Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Format of PJL Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PJL Syntax Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Types of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Processing Invalid Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2-4 2-5 2-7 2-9
3 Using PJL
Overview of How Commands are Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PJL Job Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some Sample PJL Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What's Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command Groupings by Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 3-3 3-4 3-5 3-6
4 Kernel Commands
Universal Exit Language (UEL) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COMMENT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Methods of Printer Language Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EN
4-2 4-4 4-6 4-7
Contents-i
5 Job Separation Commands
JOB Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 EOJ Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 PJL Job Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Password Protection of Default Feature Settings . . . . . . . . . . . . . . . . . . . 5-10 Control Panel Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Disk Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Job Cancellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 Start of Job Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 End of Job Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14 Job Cancellation Unsolicited Status . . . . . . . . . . . . . . . . . . . . . . . . . . . ...