Text preview for : bpl13208.pdf part of Encad Cadjet 2 Plotter Encad Cadjet 2



Back to : bpl13208.pdf | Home

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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15

6 Environment Commands
Print Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Changing Environment Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 Environment Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 PJL Reset Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8 Key Points to Remember About Environments . . . . . . . . . . . . . . . . . . . . . . . . 6-10 PJL Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 General PJL Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12 Port-Specific Variables (LaserJet 4PJ Only) . . . . . . . . . . . . . . . . . . . . . . . 6-26 PCL-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 PostScript-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31 ESC/P-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32 Setting the Printer to a Desired State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34 DEFAULT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36 INITIALIZE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39 RESET Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42 SET Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-45

7 Status Readback Commands
Printer Status Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 Synchronizing Status Readback Responses . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 Format of Status Readback Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 INQUIRE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 DINQUIRE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 ECHO Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14 INFO Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16 USTATUS Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31 TIMED Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40 USTATUSOFF Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42 Job Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43 Sending the Initial Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43 Contents-ii
EN

After Job Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44

8 Device Attendance Commands
RDYMSG Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 OPMSG Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5 STMSG Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7

9 PJL File System Commands
FSAPPEND Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3 FSDIRLIST Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5 FSDELETE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7 FSDOWNLOAD Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8 FSINIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9 FSMKDIR Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 FSQUERY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11 FSUPLOAD Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13 File System Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15

10 Job Management
HP LaserJet 8100 Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 HP LaserJet 8500 Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5

11 Programming Tips for Using PJL
PJL Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 Print Data Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 Printer Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5 Spoolers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11 Requesting Printer Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-18 Using Status Readback in a Multi-User System . . . . . . . . . . . . . . . . . . . . . . 11-18

A Product-Specific Feature Support
PJL Feature Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2 PJL Environment Variable Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6 HP LaserJet IIISi Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-43 Comments about HP LaserJet Printers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-44 LaserJet Printers with Reduced-Function Control Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-51 Color LaserJet Printer Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-52 HP DeskJet 1200C and 1600C Printer Family Comments . . . . . . . . . . . . . . . A-52

EN

Contents-iii

HP LaserJet 5Si/ 5SiMx/5Si Mopier Comments . . . . . . . . . . . . . . . . . . . . . . . HP LaserJet 5Si Mopier Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HP LaserJet 4000 and 5000 Series Comments . . . . . . . . . . . . . . . . . . . . . . . HP LaserJet 1100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HP LaserJet 2100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HP Color LaserJet 4500 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . HP LaserJet 8000 and 8100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . HP Color LaserJet 8500 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . .

A-56 A-57 A-59 A-61 A-62 A-63 A-64 A-65

B PJL Command Summary C Programming Examples D PJL Status Codes
Status Code Groupings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1 Informational Messages (10xxx) * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2 Background Paper Loading (11xyy) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-4 Background Paper Tray Status (12xyy). . . . . . . . . . . . . . . . . . . . . . . . . . . . D-6 Output Bin Status (15xxy) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-7 PJL Parser Errors (20xxx). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-7 PJL Parser Warnings (25xxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-9 PJL Semantic Errors (27xxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-10 Auto-Continuable Conditions (30xxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-11 PJL File System Errors (32xxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-13 Potential Operator Intervention Conditions (35xxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-14 Operator Intervention Conditions (40xxx) . . . . . . . . . . . . . . . . . . . . . . . . . D-16 Foreground Paper Loading (41xyy) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-19 Paper Jam Messages (LaserJet 5Si/5SiMx only) (42xyy) . . . . . . . . . . . . D-20 Optional (External) Paper Handling Device Messages (43xyy) . . . . . . . . D-22 LaserJet 4000 / 5000 Series Paper Jam Messages (44xyy) . . . . . . . . . . D-23 Hardware Errors (50xxx). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-24

Glossary Index

Contents-iv

EN

1

Introduction to PJL
What is PJL?
Hewlett-Packard's Printer Job Language (PJL) was developed to give software applications more job-level printer control, and to provide printer status information to applications. PJL provides for the special needs of networks and other multi-user systems, in addition to enabling applications to simulate control panel functions that previously could not be controlled without pressing control panel keys. For the HP printers (HP LaserJet, HP DeskJet, and HP DesignJet) that support it, PJL allows job-level control that cannot be accomplished with PCL, PostScript, or other printer languages. To provide this control, PJL functions "above" the level of PCL and other printer languages, providing four major functions: · Printer language switching between jobs · Job separation · Printer configuration · Status readback from the printer to the host computer

Note

For information about products newer than those included in this book, see the Printer Job Language Technical Reference Addendum, which includes product-specific information about newer products, as well as commands and variables added to PJL to support these newer products.

EN

Introduction to PJL 1-1

Figure 1-1

PJL Resides Above Other Printer Languages

Note

Some HP printers, such as the LaserJet 4L, 5L, 6L, or 1100 Series printers, do not support printer language switching or job separation. See Appendix A for feature support information. Using PJL, software applications can request information such as printer model, configuration, and status. PJL also can be used to change control panel settings and modify the message displayed on the control panel, or change feature settings in printers without a control panel, such as the HP LaserJet 1100 Series printers. For those printers supporting more than one printer language, applications can print one job using PCL, and then print the next job using PostScript or another printer language--without any operator intervention.

1-2 Introduction to PJL

EN

The Benefits of PJL
Listed below are some of the benefits PJL provides: · Programmatic printer language switching. PJL provides fully reliable switching between printer languages, such as PCL, Epson, IBM ProPrinter, and PostScript, directly from within applications. · Printer status readback. Printer model information, configuration, printer feature settings, and other printer status information can be obtained using PJL. · Programmatic front panel control. Control panel settings, including control panel messages, can be changed remotely. · Ease of use. All PJL commands except the Universal Exit Language (UEL) command consist of printable characters and plain-English words or abbreviated words. Learning to use PJL can be accomplished by reading the first three chapters of this manual and following the examples provided in the text. · Better spooler control. PJL allows spoolers improved printer management, especially in a network environment.

Who Should Use PJL?
PJL is designed to be used by experienced programmers, such as software application developers and technical support personnel. Although PJL is not complicated, it is a powerful tool, and should be used only by experienced users who can create jobs that cause no adverse effects on other jobs in a shared environment. Applications containing PJL commands used as described in this manual provide users with smooth transitions between print jobs. Conversely, improperly used PJL commands can create problems in multi-user printing environments.

EN

Introduction to PJL 1-3

Compatibility With Non-PJL Printers
Because all HP printers do not support PJL, it is important to know what happens when PJL commands are sent to a non-PJL printer. PJL commands are recognized by the following HP printers: · LaserJet IIISi, 4Si, 4SiMx, 5Si, 5SiMx, 5Si Mopier · LaserJet 1100 Series, 2100 Series · LaserJet 4000 Series, 5000 Series · LaserJet 8000 Series, 8100 Series · LaserJet 4V, 4MV · LaserJet 4, 4 Plus, 4M, 4M Plus, 5, 5M · LaserJet 4L, 4ML, 4LJ Pro, 4LC, 5L, 6L · LaserJet 4P, 4MP, 4PJ, 5P, 6P, 6MP · Color LaserJet, Color LaserJet 5, 5M · Color LaserJet 4500 Series, 8500 Series · DeskJet 1200C, 1600C · DesignJet Family · PaintJet XL300 The printers listed above are designed to handle any PJL command, even those not supported by that particular printer. On the other hand, all PCL 4 printers, and all PCL 5 printers not listed above, do not support PJL. When PJL commands are sent to a non-PJL printer, the results differ depending on which commands are used and which printer language is used. The following paragraphs explain what happens when PCL and PostScript jobs containing PJL commands are sent to non-PJL printers.

Note

For best results, do not send PJL commands to a non-PJL printer.

1-4 Introduction to PJL

EN

PCL Jobs
When non-PJL printers receive PCL jobs, any PJL commands that precede the initial PCL printer reset command (E) print as ASCII text. When the initial printer reset command is received, it causes a page eject and the PCL job begins on a new page. The end result is a page or more of PJL commands followed by the PCL job, and possibly followed by more PJL commands. The PCL job should print as it would without any PJL commands, as long as the PCL portion of the job begins and ends with a PCL printer reset command. However, a page of PJL commands printed before and probably after the PCL job can be expected. For those PCL applications that do not begin with a PCL printer reset command (or another PCL command that forces a page eject when preceded by printable data), the PJL commands are printed as ASCII text on the same page as the PCL job. A good portion of the job may be unusable due to unpredictable page breaks and overprinted text on the first page.

PostScript Jobs
When non-PJL printers are running in PostScript mode, PJL commands cause a PostScript error and prevent the job from printing. Pressing the printer's Continue key removes the error message, but the error causes the printer to discard the PostScript job.

Other Printer Languages
PJL code is interpreted differently when running different printer languages on non-PJL printers. To avoid printing problems, do not use PJL commands when printing to any non-PJL printer, regardless of which printer language is used.

EN

Introduction to PJL 1-5

1-6 Introduction to PJL

EN

2
Note

PJL Command Syntax and Format
Introduction
This chapter explains the conventions used to describe PJL command syntax. This chapter also describes the several different formats that PJL commands may take, giving examples of each. The chapter provides an explanation of how PJL-compatible printers handle illegal commands.

For information about products newer than those included in this book, see the Printer Job Language Technical Reference Addendum, which includes product-specific information about newer products, as well as commands and variables added to PJL to support these newer products.

EN

PJL Command Syntax and Format 2-1

Syntax Conventions
The following syntax conventions are used to describe the PJL commands in this manual: variables COMMANDS Items in italics indicate names of variables. Items in uppercase letters indicate PJL command names and words that you type verbatim. PJL command names referred to in text are also in uppercase. Items in brackets [ . . . ] indicate optional parameters. The brackets themselves are not typed. Identifies a control code character, such as for carriage return, or a special defined identifier. The table on the next page lists the control codes and special identifiers used in the PJL syntax. (The < and > symbols themselves are not typed, but are replaced with the control codes or special identifiers they represent. For example, replace with the form feed character [ASCII 12].) This character indicates that the current line of code is a continuation of the previous line. For example, "All of this text belongs on the ~ same line." A vertical bar indicates there is more than one optional parameter, such as LPARM and IPARM: [LPARM : personality | IPARM : port].

[] <>

~

|

2-2 PJL Command Syntax and Format

EN

The following illustration is an example of a PJL command line containing the ENTER command:

The table below lists the control codes and special identifiers used in this manual: Horizontal tab character (ASCII 9). Line feed character (ASCII 10). Carriage return character (ASCII 13). Space character (ASCII 32). Escape character (ASCII 27). Form feed character (ASCII 12). White space, a result of one or more or . Printable characters (Roman-8 characters 33 through 255) and , starting with a printable character. PostScript end-of-file indication. It is not part of PJL, but is used to end PostScript examples.

^D

EN

PJL Command Syntax and Format 2-3

Format of PJL Commands
All PJL command lines follow one of the following four formats. Each format defines how commands using that format are structured.

Format #1
%­12345X The only command that uses this format is the Universal Exit Language (UEL) command.

Format #2
@PJL [] This format allows a PJL line with no command, and is used to add clarity to PJL command listings. You can use one or more of these commands to visually break up several lines of PJL commands.

Format #3
@PJL command [] [] The COMMENT and ECHO commands currently are the only PJL commands using format number 3.

Format #4
@PJL command [command modifier : value] ~ [option name [= value]] [] This format is used for all of the other PJL commands and is described in more detail below. command -- command is one of the assigned PJL command names, such as ENTER, RDYMSG, or RESET. [command modifier : value] -- The command modifier enables the user to specify what is effected by the command. For example, with the command modifier LPARM you can specify language-specific variables. A PJL command with a command modifier of LPARM : PCL only affects PCL-specific settings. A PJL command can contain only one command modifier. For example, in the command: @PJL SET

2-4 PJL Command Syntax and Format

EN

[LPARM : personality]|[IPARM : port] variable = value [] , you can use either the LPARM command modifier or the IPARM command modifier, but not both. [option name [ = value ] ] -- The option parameter specifies an option or sets a command option to a certain value. Examples include "@PJL INQUIRE COPIES" and "@PJL ENTER LANGUAGE = personality." The range of values varies with each specific command and each printer model. A PJL command may have no options, or one or more options (an unlimited number). The DEFAULT command shown below illustrates format number 4. The command sets the default PCL point size to 14.25.

PJL Syntax Rules
Following are the rules governing the use of PJL commands: · The PJL prefix "@PJL" always must be uppercase. The remainder of the PJL command is not case-sensitive. For clarity, however, this manual shows other portions of PJL commands in uppercase to indicate portions that are not variable and that should be typed as shown (such as the first three words in the following command): @PJL STMSG DISPLAY = "message" [] · Spacing between characters, or "white space," is comprised of one or more of either the space character (ASCII 32) or the horizontal tab character (ASCII 9). For clarity and consistency, this manual shows all white space as one blank space.

EN

PJL Command Syntax and Format 2-5

· The placement of white space in PJL commands depends on its location within the command. Some white space is required and some is optional: · White space is required between the @PJL prefix and the PJL command name, and between the PJL command name and command modifiers. For example: @PJL OPMSG DISPLAY or @PJL ENTER LANGUAGE = personality · If white space is shown in any other place in the command, it is optional (see the examples below). · If white space is not shown between two portions of a command, white space is not allowed. An example is between the optional carriage return and required line feed character that terminate most commands. For clarity, this manual consistently shows white space as one blank space. The PJL language requirements are shown in both examples below:

2-6 PJL Command Syntax and Format

EN

Types of Variables
PJL uses alphanumeric variables, numeric variables, and strings. The following explains the three types of variables and their ranges. · Alphanumeric variables. Any combination of letters and digits, with the stipulation that the first character always must be a letter. Letters consist of the uppercase letters (Roman-8 characters 65 through 90) and lowercase letters (97 through 122). Digits consist of numbers 0 through 9 (characters 48 through 57). Examples of valid alphanumeric variables include: LaserJet279 J1953 Examples of invalid alphanumeric variables include: 279LaserJet (Alphanumeric variables must begin with a letter) J 1953 (Space characters [ASCII 32] are not allowed in alphanumeric variables) · Numeric variables. Any number consisting of digits, with one optional decimal point and an optional + or ­ sign preceding the first digit. Only one decimal point may be used, and it must be placed somewhere after the first digit. Digits are not required after the decimal point. Examples of valid numeric variables include: 0.123456 ­123.456 +657000 2468. Examples of invalid numeric variables include: .123456 (The decimal point must be preceded by at least 1 digit) ­123.45.6 (Only 1 decimal point is allowed in a numeric variable) +657,000 (Commas are not allowed in numeric variables)

EN

PJL Command Syntax and Format 2-7

· Strings. Enclosed in quotation marks, strings consist of any combination of characters from Roman-8 character 32 through 255, plus character 9 (horizontal tab), excluding character 34 (quotation marks). Examples of valid strings include: "This is a valid string." (Tabs are allowed in strings) "Print job #4655" Examples of invalid strings include: "This is not a valid" string." (Strings cannot contain quotation marks) "This is also notvalid." ( is not within the valid range of characters for a string.) Note Strings displayed on the printer control panel are generally displayed using the Roman-8 symbol set. On HP LaserJet 4PJ, 4V, and 4MV printers, when the language is set to Japanese, strings which correspond to a control panel message are displayed on the control panel using the JIS X0201-76 character set. This is also true for some other printers/languages. See the note on page 8-3.

2-8 PJL Command Syntax and Format

EN

Processing Invalid Commands
There are two general types of invalid commands: those commands with syntax errors, and those that have syntax or semantic warnings. Each type is handled differently. · Syntax errors cause the printer to ignore the entire PJL command, and include errors such as unrecognized commands and command modifiers, strings missing closing double-quotes, numeric values missing digits before the decimal point, and numeric values encountered when alphanumeric values are expected. When the printer receives commands with syntax errors, it ignores the entire command. For example, the value portion of the JOB command's NAME option is a string and requires double quotes around the value (as shown below). In the second example below, the JOB command is ignored since the string (April Paychecks) contains the opening but not the required closing quotes. Valid command: @PJL JOB NAME = "April Paychecks" Invalid command: @PJL JOB NAME = "April Paychecks · Syntax warnings and semantic warnings are issued for commands such as those having unsupported options, values that are out of range, values that are the wrong type or missing, or values that are included when none are allowed. When the printer receives commands with syntax or semantic warnings, it executes as much of the command as possible, but the portion of the command containing the warning is ignored. · For example, in the following two sample PJL commands, START is a valid option for the JOB command, but FINISH is not a valid option (the END option should be used). The START option is executed, but the FINISH option is ignored. Valid command: @PJL JOB START = 1 Invalid command: @PJL JOB START = 1 FINISH = HOME

EN

PJL Command Syntax and Format 2-9

Note

Any errors that occur during PJL parsing can be received by enabling device status as described in Chapter 7 (send the @PJL USTATUS DEVICE = VERBOSE command). Appendix D lists the status codes that are received by the host when an invalid command is received and unsolicited verbose device status is enabled.

2-10 PJL Command Syntax and Format

EN

3

Using PJL
Introduction
This chapter describes how PJL commands are used. After reading this chapter, you can create basic jobs and perform simple PJL tasks, such as printer language switching and changing some PJL feature settings. To give you an understanding of where to look for more PJL information, this chapter explains how the manual categorizes PJL commands into groups of related commands. Each command has a brief description of its function to help familiarize you with the PJL language.

Note

Each PJL printer supports a different set of PJL commands. See Appendix A for printer-specific information.

Note

For information about products newer than those included in this book, see the Printer Job Language Technical Reference Addendum, which includes product-specific information about newer products, as well as commands and variables added to PJL to support these newer products.

Overview of How Commands are Used
As previously explained, PJL resides "above" other printer languages such as PCL and PostScript. PJL commands encapsulate the printer language jobs, as shown in Figure 3-1. The Universal Exit Language (UEL) command allows the printer to alternate between interpreting PJL commands and printer language commands. (Although PCL and PostScript are shown in Figure 3-1, other printer languages can be involved.)

EN

Using PJL 3-1

PJL Code Figure 3-1

PCL Job

PJL Code

PostScript Job

PJL Code

PJL Commands Encapsulate Print Jobs

3-2 Using PJL

EN

PJL Job Requirements
PJL has certain job requirements that must be met to work correctly. Jobs that satisfy the following requirements are "well-formed" and work well with all PJL printers, both in single-computer/single-printer environments and network environments. Here are the requirements: · All PJL jobs must begin and end with a UEL command (%­12345X). This command exits the current printer language and returns control to PJL. · The UEL command at the beginning of the job must be immediately followed by the PJL command prefix (@PJL). The "@PJL" can be followed by an optional carriage return and a required line feed character, or it can be the prefix of another PJL command (see the two following examples). No other characters, including control characters, are allowed between the UEL command and the @PJL prefix. · The UEL command at the job end must not be followed by anything (except the first character of the next job). · Line Termination--a line feed character () is required to terminate all PJL commands (except the UEL command). A carriage return can precede the terminating line feed, however the carriage return is optional and is ignored. · No blank command lines are allowed. The command @PJL [] is provided for situations where a blank line is needed to add space between command lines. The following command lines demonstrate two ways to begin a job while satisfying PJL requirements. Both lines begin with a UEL command, are immediately followed by @PJL, and are terminated with a line feed character. All PJL jobs also must end with a UEL command. The examples on the following page demonstrate how to begin and end a PJL job. %­12345X@PJL %­12345X@PJL COMMENT *Start Job*

EN

Using PJL 3-3

Some Sample PJL Jobs
This section consists of two basic PJL jobs that illustrate how to use PJL. The first job changes a few printer control panel settings and prints a PCL file. The second job prints a PCL file followed by a PostScript file. (The ~ symbol indicates that the command line is actually part of the previous line.)

Example: Changing Control Panel Settings
This example simulates using PJL to control printer features that are not available in a particular application program. In this case, the features to be modified are the number of copies and the Resolution Enhancement technology setting. %­12345X@PJL COMMENT *Start Job* @PJL JOB NAME = "Sample Job #1" @PJL SET COPIES = 3 @PJL SET RET = OFF @PJL ENTER LANGUAGE = PCL E. . . . PCL job . . . .E ~%­12345X@PJL @PJL EOJ %­12345X

Example: Switching Printer Languages
This example contains two print jobs, one PCL and one PostScript. The PCL job prints first, then PJL code switches the printer language to prepare for the PostScript job. %­12345X@PJL @PJL COMMENT ** Beginning PCL Job ** @PJL ENTER LANGUAGE = PCL @PJL SET LPARM : PCL SYMSET = DESKTOP E . . . . PCL job . . . .E ~%­12345X@PJL COMMENT End PCL @PJL COMMENT Ready for PostScript Job @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-ADOBE ... PostScript print job ... ^D ~%­12345X

3-4 Using PJL

EN

What's Next?
Now that you have learned the PJL requirements and have seen how to use PJL commands in the sample programs described on the previous page, look through the following "Command Groupings" table. It can help you find the information you need to add PJL capabilities to your application. If your application only uses PJL to switch printer languages, you may need to read only Chapter 4. However, if you want to do more with PJL, be sure to look through Chapter 11 (Programming Tips for Using PJL), and the other chapters that pertain to your application. Also, be sure you know which PJL commands are supported by the printer you are using. See Appendix A for feature support information. · Chapter 5 explains commands that enable you to create jobs for keeping track of printing status, and explain a non-printing mode that allows printing of specific pages of print jobs. · Chapter 6 describes commands that enable you to change control panel settings and default configuration settings. The commands in this chapter enable you to set the printer features to a known state. · Chapter 7 covers status readback commands, enabling you to request configuration and status information from the printer. · Chapter 8 explains the commands that can alter the messages displayed on the printer control panel. · Chapter 9 describes the PJL file system for managing printer-based file storage. · Chapter 10 describes using the PJL job management commands.

EN

Using PJL 3-5

Command Groupings by Functionality
This manual categorizes the PJL commands into related groups. Each group of commands is covered in a separate chapter, as indicated in the following table. This table lists each command and gives a short description of each. Command Group Kernel Commands (Chapter 4) Command Universal Exit Language (UEL) COMMENT Command Description Exits current printer language and returns control to PJL. Causes PJL to accept the command line as a comment. Selects a printer language for processing the current job. Informs printer of the start of a print job, resets the page count, allows naming of the job, supports non-printing mode for printing portions of jobs. Where supported, it adds PJL password security. Tells printer the print job is complete, resets the page count. Sets default value for environment variables. Sets an environment variable to a specified value for the duration of a PJL job. Resets current and default PJL variables to factory default values. Resets current PJL variables to default values.

ENTER

Job Separation Commands JOB (Chapter 5)

EOJ

Environment Commands (Chapter 6)

DEFAULT SET

INITIALIZE

RESET

3-6 Using PJL

EN

Command Group Status Readback Commands (Chapter 7)

Command INQUIRE

Command Description Requests the current value for a specified environment variable. Requests the default value for a specified environment variable. Returns the portion of the command to the host computer. Requests a specified category of printer information, such as printer model number, printer memory available, configuration, page count, status, environment variables, and unsolicited status variables. Allows printer to send unsolicited status messages for device status changes, end-of-job status, and pages printed. Status can be sent at specified time intervals. Turns off all unsolicited status.

DINQUIRE

ECHO

INFO

USTATUS

USTATUSOFF

EN

Using PJL 3-7

Command Group Device Attendance Commands (Chapter 8)

Command RDYMSG

Command Description Specifies a message that replaces the READY message on the printer control panel. Does not affect online state. Displays specified message on printer control panel and takes printer offline. Displays specified message on printer control panel and takes printer offline. If status readback is enabled, returns name of the key (ON LINE, CONTINUE, or RESET) that operator presses to return the printer online. Appends data to an existing file or creates a new file. Deletes printer mass storage files. Lists PJL file system files and directories. Downloads files to the printer mass storage system. Initializes the printer mass storage file system. Creates a directory on the printer mass storage file system. Queries existence of directories and files and returns file sizes. Uploads all or part of a file from the printer to the host.

OPMSG

STMSG

PJL File System Commands (Chapter 9)

FSAPPEND FSDELETE FSDIRLIST

FSDOWNLOAD

FSINIT FSMKDIR

FSQUERY

FSUPLOAD

3-8 Using PJL

EN

EN

Using PJL 3-9

3-10 Using PJL

EN

4

Kernel Commands
Introduction
This chapter explains the following three PJL commands: · Universal Exit Language (UEL) command -- exits the current printer language and returns control to PJL. · ENTER command -- selects a printer language for processing the current job. · COMMENT command -- enables developers to add comments to their PJL commands. Together, these commands provide a minimum set of tools necessary to implement job control. These commands allow applications to set job boundaries, add comments, and programmatically select printer languages. Besides programmatic printer language switching, you can configure some LaserJet printers to switch printer languages automatically between print jobs. Following the descriptions of the UEL, ENTER, and COMMENT commands, this chapter describes the different methods used to switch printer languages.

Note

For information about products newer than those included in this book, see the Printer Job Language Technical Reference Addendum, which includes product-specific information about newer products, as well as commands and variables added to PJL to support these newer products.

EN

Kernel Commands 4-1

Universal Exit Language (UEL) Command
The Universal Exit Language (UEL) Command causes the printer to exit the active printer language. The printer then returns control to PJL.

Note

Use the UEL command at the beginning and end of every PJL job. You do not need a UEL command before every PJL command. The examples demonstrate using this command.

Syntax:
%-12345X

Parameters:
The UEL command does not use any parameters.

Comments:
The UEL command is a data stream sequence recognized by all printer languages in PJL printers. The UEL command instructs the active printer language to finish processing the current job and relinquishes control to PJL. If PJL is active, any unprocessed PJL commands are discarded and the printer is ready to accept the next PJL command.

Note

If the printer is processing a PostScript job and TBCP is enabled, the UEL command causes the printer to exit PostScript and enable PJL. Remember that: · All jobs must start and end with the UEL command. Printers that support I/O switching use the UEL command as one way to determine job boundaries, indicating when to perform I/O switching (see the "Timeouts" section in Appendix A). · At the beginning of a PJL job, the PJL command prefix (@PJL) must immediately follow the UEL command. If the printer receives any characters, spaces, or control codes before @PJL, it enables the default printer language and processes the job in that printer language (if PERSONALITY =AUTO, the data stream is sampled for context-sensitive switching--see

4-2 Kernel Commands

EN

the "Methods of Printer Language Switching" later in this chapter). Instead of relying on implicit switching, use the ENTER command to specify the printer language, even if the printer has only one printer language. The following example demonstrates the use of the UEL command.

Example: Using the UEL Command
This example enters PCL and prints a PCL job. Notice how the job begins and ends with the UEL command, and how the first UEL command is followed immediately by the @PJL prefix. %-12345X@PJL COMMENT PCL Job @PJL ENTER LANGUAGE = PCL E . . . . PCL Job . . . . E ~%-12345X If the print job was a PostScript job instead, the following would be sent: %-12345X@PJL COMMENT PostScript @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-ADOBE ... PostScript print job ... ^D ~%-12345X Similarly, for an ESC/P print job, send the following: %-12345X@PJL COMMENT ESC/P @PJL ENTER LANGUAGE = ESCP ... ESC/P print job ... ~%-12345X

EN

Kernel Commands 4-3

ENTER Command
The ENTER command enables the specified personality (such as PCL or PostScript). Use this command to select the printer language for printing subsequent data.

Syntax:
@PJL ENTER LANGUAGE = personality []

Parameters:
Parameter personality Range PCL, POSTSCRIPT, ESCP, Others *

* Other personalities might be supported. · personality -- The personality variable must be set to PCL, POSTSCRIPT, ESCP, or one of the other supported personalities. Personalities besides PCL and PostScript can be added to some printers by plugging in additional hardware, such as cartridges or ROM SIMMs. If your application handles status readback, you can request a list of all valid personalities present in the printer (see the "INFO CONFIG" section in Chapter 7).

Comments:
The ENTER command must be positioned immediately before any personality-specific data. The selected personality begins parsing immediately after the that terminates the ENTER command. If the printer does not receive the ENTER command requesting a specific printer language, the printer enables the default printer language as set from the control panel (or if the printer supports context switching, such as the HP Color LaserJet 4500 series, 8500 series, 8100 series, LaserJet 2100 series, 4000 series, 5000 series, 8000 series, 8100 series, 5Si, 5SiMX, 5Si Mopier, 5, 5M, 5P, 6P, and 6MP printers, it samples the data stream if personality is set to AUTO--see the "Methods of Printer Language Switching" later in this chapter).

4-4 Kernel Commands

EN

Note

To select the ESC/P personality, always be sure to use the @PJL ENTER LANGUAGE = ESCP command to explicitly select it. For any job containing personality-specific data, send the ENTER command if the intended printer language is known, instead of relying on the printer's ability to switch to the default printer language. This is true even if there is only one available personality. When a printer language is specified, that language currently must be installed in the printer. If the printer receives a request for an invalid printer language, the printer consumes the data stream until it finds the next UEL command, and then discards the data. The printer also posts an "invalid personality" clearable warning message (W2 INVALID PERS) and, if enabled, returns a status message.

Note

In spooling applications, performance is not adversely affected if both the application file and the spooler send the ENTER command.

Example: Using the ENTER Command
%-12345X@PJL @PJL COMMENT Beginning PostScript Job @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-ADOBE ... PostScript print job ... ^D ~%-12345X@PJL @PJL COMMENT End of PostScript Job @PJL @PJL @PJL COMMENT Prepare for PCL Job @PJL ENTER LANGUAGE = PCL E . . . . PCL Job . . . . E ~%-12345X

EN

Kernel Commands 4-5

COMMENT Command
The COMMENT command enables you to add a line of information as a comment. Use this command whenever you want to add an explanation to PJL commands.

Syntax:
@PJL COMMENT remarks []

Parameters:
Parameter remarks Range Roman-8 character codes 33 through 255 and , starting with a printable character.

Comments:
The COMMENT command is useful for documenting lines of PJL commands. Comments may be placed anywhere in the PJL code between the initial UEL command and the ENTER command. (Comments placed after the ENTER command are considered personality-specific data and are printed as determined by the active printer language.) Like other PJL commands, the COMMENT command is terminated by a line feed character. You cannot extend comments onto the next line. Comments longer than one line require a separate COMMENT command for each line. See the following page for an example demonstrating the use of the COMMENT command.

Example: Using the COMMENT Command
This example demonstrates using the COMMENT command to add clarity to your PJL command listings. %-12345X@PJL @PJL COMMENT ************************ @PJL COMMENT ** D. Thiel-- 10/22/92 ** @PJL COMMENT ************************ @PJL 4-6 Kernel Commands
EN

@PJL @PJL JOB NAME = "Using Comments" @PJL @PJL @PJL COMMENT **** TURNING OFF **** @PJL COMMENT **** RESOLUTION **** @PJL COMMENT **** ENHANCEMENT **** @PJL SET RET = OFF @PJL @PJL COMMENT ***** ENTERING PCL ***** @PJL ENTER LANGUAGE = PCL E . . . . PCL Job . . . . E ~%-12345X@PJL @PJL EOJ %-12345X

Methods of Printer Language Switching
There are three methods of switching printer languages, two of which are supported by all PJL printers. All three methods are described below: · Explicit Switching. With explicit switching, the ENTER LANGUAGE command is used to "explicitly" select the desired printer language. This is the preferred switching method because it ensures that the specified printer language is always selected (see Figure 4-1). · Implicit Switching. If the printer has a default printer language configured, and the print job does not explicitly select a printer language using the ENTER LANGUAGE command, the printer automatically switches to the default printer language. (See the User's Manual for each printer for instructions about specifying a default printer language.) This switching method does not always ensure that the proper printer language is used, since the printer simply uses the default language. · Context Switching (HP Color LaserJet 4500 series, 8500 series, 8100 series, LaserJet 2100 series, 4000 series, 5000 series, 8000 series, 8100 series, HP Color LaserJet, LaserJet 4, 4M, 4 Plus, 4M Plus, 4Si, 4SiMx, 4000 series, 5Si, 5SiMx, 5Si Mopier, 4ML, 4P, 4MP, 4V, 4MV, 5P, 6P, 6MP, DesignJet plotters and printers only). If the printer is set to automatically select a printer language (see the printer user's manual), and the print job does not explicitly select a printer language using the ENTER LANGUAGE command, the printer samples the incoming data and looks for indications of a
EN

Kernel Commands 4-7

particular printer language. Once it recognizes the printer language, the printer backs up to the beginning of the sampled print data and switches to the printer language determined to be most appropriate. Then it begins to parse the data in the newly selected printer language. Note HP LaserJet 4V and 4MV printers cannot properly context-switch into the ESC/P personality by sensing the data stream. Developers who use ESC/P must use explicit or implicit switching. Although printers supporting context switching can select printer languages accurately, we recommend that every job containing printable data include an ENTER LANGUAGE command to explicitly select the correct printer language. This method improves performance and eliminates unintentional printer language switching, which can potentially cause data loss. Performance is not adversely affected if both the application and the spooler send the ENTER LANGUAGE command.

Figure 4-1

Switching Printer Languages

4-8 Kernel Commands

EN

5

Job Separation Commands
Introduction
This chapter explains the JOB and EOJ commands. These commands are used to describe the boundaries of a job, indicating where the PJL job begins and ends. The commands can be used to name a job, and they support a non-printing mode for printing selected pages within a job. When used in combination with status readback, the printer also can send status information regarding when the printer starts processing the job and when the job is complete. This chapter also describes PJL security and job cancellation and their relationship to the JOB command.

Note

For information about products newer than those included in this book, see the Printer Job Language Technical Reference Addendum, which includes product-specific information about newer products, as well as commands and variables added to PJL to support these newer products.

EN

Job Separation Commands 5-1

JOB Command
The JOB command informs the printer of the start of a PJL job and synchronizes the job and page status information. It also is used to specify which pages of a job are printed. Use the JOB/EOJ commands for spooling and related applications to monitor printing status, name a job, print portions of a job, or to mark job boundaries to keep the printer from treating a single print job as multiple jobs (for example, when printing a job with a banner page). Also, in jobs sent to those printers supporting the PASSWORD option, use a JOB command to specify the correct password. For printers that support the DISPLAY variable, the JOB command can be used to display a control panel message while printing the job.

Note

The JOB and EOJ commands always are used in pairs. Do not use one without the other. Since the JOB command causes a reset condition, any SET commands must be positioned after the JOB command.

Syntax:
@PJL JOB [NAME = "job name"][START=first page] ~[END = last page][PASSWORD = number ] ~[DISPLAY = "display text"][]

Parameters:
Parameter NAME = "job name" START = first page END = last page PASSWORD = number DISPLAY="display text" Functional Range Roman-8 characters 33 thru 255, , 1 to 2,147,483,647 1 to 2,147,483,647 0 to 65,535 Roman-8 characters 33 thru 255, , Default N/A 1 Entire job 0 N/A

5-2 Job Separation Commands

EN

· NAME = "job name" -- The command option NAME tags the print job with a job name. The variable job name can be any combination of printable characters and spaces or horizontal tab characters, with a maximum of 80 significant characters. The job name variable is a string and must be enclosed in double quotes, as shown in the command syntax. If the NAME option is included, the unsolicited job status includes the job name (if unsolicited job status is enabled). · START = first page -- The command option START is used to provide a non-printing mode for skipping to a selected portion of the job. It indicates the first page that is printed. If the START option is omitted, the printer starts printing at the beginning of the job. If the end of the job comes before the START page, no pages are printed. Note For duplex jobs, the front and/or back side of the page is also printed, depending on the value of START/END. If START is an even number, the front side of that page will also be printed. If END is an odd value, the backside of that page will also be printed. This allows the selected pages to be inserted back into the original duplex job. · END = last page -- The command option END indicates the page number of the last page to be printed. The last page variable is relative to page 1 of the print job. If the END variable is omitted, the printer prints to the end of the job. If the end of the job is encountered before the START page, no pages are printed. If the end of job is encountered before the END page, printing terminates. Additionally, if the START page is greater than the END page, no pages are printed. · PASSWORD = number -- The command option PASSWORD allows the application to modify the NVRAM variables if the password matches the active password variable. (Using PJL, the NVRAM variables are modified using either the DEFAULT or INITIALIZE commands; some printer language commands may also modify NVRAM variables.) Passwords are set using the DEFAULT command. The default password value is 0, which indicates PJL security is disabled--any job can modify printer feature settings using the DEFAULT or INITIALIZE commands. If any other password value is active, PJL jobs must issue the correct password value or they are disabled from using the DEFAULT or INITIALIZE commands. (See the "PJL Job Security" section at the end of this chapter.)

EN

Job Separation Commands 5-3

· DISPLAY="display text " -- The command option DISPLAY is used to display a job message on the control panel display. The message is displayed when the printer begins to work on this job and is removed when the last page of this job reaches the output bin. The variable "display text" can be any combination of printable characters and spaces or horizontal tabs, with a maximum of 80 characters. The actual number of characters displayed depends on the printer. The display limit can be determined by sending an INFO CONFIG command to the printer. The printer will return DISPLAY LINES = value and DISPLAY CHARACTER SIZE = value as part of the response. Note For HP LaserJet 4PJ, 4V, 4MV, 5Si, 5SiMx, 5Si Mopier printers, if the LANG variable is set to Japanese, messages are displayed using the JIS X0201-76 character set. For the LaserJet 4000, 5000, 8000, and 8100 series printers, if LANG is set to POLISH, CZECH, or HUNGARIAN, messages are displayed using the Latin 2 (ISO 8859/2) character set. If LANG is RUSSIAN, messages are displayed using Cyrillic (ISO 8859/5). For LANG=TURKISH, the display is in Latin 5 (ISO 8859/9). This is also true for the HP Color LaserJet 4500 printer, except there is no support for Turkish or Hungarian on this printer.

Comments:
When a JOB command is received, the printer does not recognize the UEL command as a PJL job boundary until an EOJ command is received. UEL commands within a PJL JOB/EOJ command pair are treated as printer language resets; they default the print environment to the PJL Current Environment settings, instead of the User Default Environment. If your application has status readback capabilities, you can monitor the job status using the USTATUS command with the JOB option. If job status is enabled and the printer receives a JOB command, it retur