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.
The information contained in
this document is subject to
change without notice.
Publication Number: 5021-0380
Edition 12, 6/2003
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 MS-
Gothic 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.
EN iii
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.
iv EN
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” commandsthose 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.
EN v
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 printer-
based 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.
vi EN
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 printer-
specific 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.
EN vii
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.
viii EN
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, <CR> 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.
EN Contents-i
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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Format of PJL Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
PJL Syntax Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Types of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Processing Invalid Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
3 Using PJL
Overview of How Commands are Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
PJL Job Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Some Sample PJL Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
What's Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
Command Groupings by Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
4 Kernel Commands
Universal Exit Language (UEL) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
ENTER Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
COMMENT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Methods of Printer Language Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Contents-ii EN
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
EN Contents-iii
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
Contents-iv EN
HP LaserJet 5Si/ 5SiMx/5Si Mopier Comments . . . . . . . . . . . . . . . . . . . . . . . A-56
HP LaserJet 5Si Mopier Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-57
HP LaserJet 4000 and 5000 Series Comments . . . . . . . . . . . . . . . . . . . . . . . A-59
HP LaserJet 1100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-61
HP LaserJet 2100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-62
HP Color LaserJet 4500 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . A-63
HP LaserJet 8000 and 8100 Series Comments . . . . . . . . . . . . . . . . . . . . . . . A-64
HP Color LaserJet 8500 Series Comments . . . . . . . . . . . . . . . . . . . . . . . . . . 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
EN Introduction to PJL 1-1
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.
1-2 Introduction to PJL EN
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 languagewithout any operator
intervention.
EN Introduction to PJL 1-3
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.
1-4 Introduction to PJL EN
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.
EN Introduction to PJL 1-5
PCL Jobs
When non-PJL printers receive PCL jobs, any PJL commands that
precede the initial PCL printer reset command (<ESC>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.
1-6 Introduction to PJL EN
EN PJL Command Syntax and Format 2-1
2
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.
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.
2-2 PJL Command Syntax and Format EN
Syntax Conventions
The following syntax conventions are used to describe the PJL
commands in this manual:
variables Items in italics indicate names of variables.
COMMANDS 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 <CR> 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
<FF> 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].
EN PJL Command Syntax and Format 2-3
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:
<HT> Horizontal tab character (ASCII 9).
<LF> Line feed character (ASCII 10).
<CR> Carriage return character (ASCII 13).
<SP> Space character (ASCII 32).
<ESC> Escape character (ASCII 27).
<FF> Form feed character (ASCII 12).
<WS> White space, a result of one or more <SP>
or <HT>.
<words> Printable characters (Roman-8 characters 33
through 255) and <WS>, starting with a printable
character.
^D PostScript end-of-file indication. It is not part of
PJL, but is used to end PostScript examples.
2-4 PJL Command Syntax and Format EN
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
<ESC>%–12345X
The only command that uses this format is the Universal Exit
Language (UEL) command.
Format #2
@PJL [<CR>]<LF>
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 [<words>] [<CR>]<LF>
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]] [<CR>]<LF>
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
EN PJL Command Syntax and Format 2-5
[LPARM : personality]|[IPARM : port] variable = value [<CR>] <LF>,
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" [<CR>]<LF>
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.
2-6 PJL Command Syntax and Format EN
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:
EN PJL Command Syntax and Format 2-7
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)
2-8 PJL Command Syntax and Format EN
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:
"<HT>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 not<CR>valid."
(<CR> 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.
EN PJL Command Syntax and Format 2-9
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" <LF>
Invalid command:
@PJL JOB NAME = "April Paychecks <LF>
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 <LF>
Invalid command:
@PJL JOB START = 1 FINISH = HOME <LF>
2-10 PJL Command Syntax and Format EN
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.
EN Using PJL 3-1
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.)
3-2 Using PJL EN
Figure 3-1 PJL Commands Encapsulate Print Jobs
PJL Code PCL Job PJL Code PostScript
Job
PJL Code
EN Using PJL 3-3
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
(<ESC>%–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 Terminationa line feed character (<LF>) 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 [<CR>]<LF> 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.
<ESC>%–12345X@PJL <CR><LF>
<ESC>%–12345X@PJL COMMENT *Start Job* <CR><LF>
3-4 Using PJL EN
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.
<ESC>%–12345X@PJL COMMENT *Start Job* <CR><LF>
@PJL JOB NAME = "Sample Job #1" <CR><LF>
@PJL SET COPIES = 3 <CR><LF>
@PJL SET RET = OFF <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E. . . . PCL job . . . .<ESC>E
~<ESC>%–12345X@PJL <CR><LF>
@PJL EOJ<CR><LF>
<ESC>%–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.
<ESC>%–12345X@PJL <CR><LF>
@PJL COMMENT ** Beginning PCL Job ** <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
@PJL SET LPARM : PCL SYMSET = DESKTOP <CR><LF>
<ESC>E . . . . PCL job . . . .<ESC>E
~<ESC>%–12345X@PJL COMMENT End PCL <CR><LF>
@PJL COMMENT Ready for PostScript Job <CR><LF>
@PJL ENTER LANGUAGE = POSTSCRIPT <CR><LF>
%!PS-ADOBE ... PostScript print job ... ^D
~<ESC>%–12345X
EN Using PJL 3-5
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.
3-6 Using PJL EN
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 Command Command Description
Kernel Commands
(Chapter 4)
Universal Exit Language
(UEL)
Exits current printer
language and returns
control to PJL.
COMMENT Causes PJL to accept the
command line as a
comment.
ENTER Selects a printer language
for processing the current
job.
Job Separation Commands
(Chapter 5)
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.
EOJ Tells printer the print job is
complete, resets the page
count.
Environment Commands
(Chapter 6)
DEFAULT Sets default value for
environment variables.
SET Sets an environment
variable to a specified value
for the duration of
a PJL job.
INITIALIZE Resets current and default
PJL variables to factory
default values.
RESET Resets current PJL
variables to default values.
EN Using PJL 3-7
Status Readback
Commands
(Chapter 7)
INQUIRE Requests the current value
for a specified environment
variable.
DINQUIRE Requests the default value
for a specified environment
variable.
ECHO Returns the <words>
portion of the command to
the host computer.
INFO 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.
USTATUS 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.
USTATUSOFF Turns off all unsolicited
status.
Command Group Command Command Description
3-8 Using PJL EN
Device Attendance
Commands
(Chapter 8)
RDYMSG Specifies a message that
replaces the READY
message on the printer
control panel. Does not
affect online state.
OPMSG Displays specified
message on printer control
panel and takes printer
offline.
STMSG 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.
PJL File System
Commands
(Chapter 9)
FSAPPEND Appends data to an existing
file or creates a new file.
FSDELETE Deletes printer mass
storage files.
FSDIRLIST Lists PJL file system files
and
directories.
FSDOWNLOAD Downloads files to the
printer mass storage
system.
FSINIT Initializes the printer mass
storage file system.
FSMKDIR Creates a directory on the
printer mass storage file
system.
FSQUERY Queries existence of
directories and files and
returns file sizes.
FSUPLOAD Uploads all or part of a file
from the printer to the host.
Command Group Command Command Description
EN Using PJL 3-9
3-10 Using PJL EN
EN Kernel Commands 4-1
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 commandselects 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.
4-2 Kernel Commands EN
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:
<ESC>%-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 switchingsee
EN Kernel Commands 4-3
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.
<ESC>%-12345X@PJL COMMENT PCL Job <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E . . . . PCL Job . . . . <ESC>E
~<ESC>%-12345X
If the print job was a PostScript job instead, the following would be
sent:
<ESC>%-12345X@PJL COMMENT PostScript <CR><LF>
@PJL ENTER LANGUAGE = POSTSCRIPT <CR><LF>
%!PS-ADOBE ... PostScript print job ... ^D
~<ESC>%-12345X
Similarly, for an ESC/P print job, send the following:
<ESC>%-12345X@PJL COMMENT ESC/P <CR><LF>
@PJL ENTER LANGUAGE = ESCP <CR><LF>
... ESC/P print job ...
~<ESC>%-12345X
4-4 Kernel Commands EN
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 [<CR>]<LF>
Parameters:
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 <LF> 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
AUTOsee the “Methods of Printer Language Switching” later in this
chapter).
Parameter Range
personality PCL, POSTSCRIPT, ESCP,
Others *
* Other personalities might be supported.
EN Kernel Commands 4-5
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
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT Beginning PostScript Job <CR><LF>
@PJL ENTER LANGUAGE = POSTSCRIPT <CR><LF>
%!PS-ADOBE ... PostScript print job ... ^D
~<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT End of PostScript Job <CR><LF>
@PJL <CR><LF>
@PJL <CR><LF>
@PJL COMMENT Prepare for PCL Job <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E . . . . PCL Job . . . . <ESC>E
~<ESC>%-12345X
4-6 Kernel Commands EN
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 [<CR>]<LF>
Parameters:
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.
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT ************************ <CR><LF>
@PJL COMMENT ** D. Thiel— 10/22/92 ** <CR><LF>
@PJL COMMENT ************************ <CR><LF>
@PJL <CR><LF>
Parameter Range
remarks Roman-8 character codes 33
through 255 and <WS>, starting
with a printable character.
EN Kernel Commands 4-7
@PJL <CR><LF>
@PJL JOB NAME = "Using Comments" <CR><LF>
@PJL <CR><LF>
@PJL <CR><LF>
@PJL COMMENT **** TURNING OFF **** <CR><LF>
@PJL COMMENT **** RESOLUTION **** <CR><LF>
@PJL COMMENT **** ENHANCEMENT **** <CR><LF>
@PJL SET RET = OFF <CR><LF>
@PJL <CR><LF>
@PJL COMMENT ***** ENTERING PCL ***** <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E . . . . PCL Job . . . . <ESC>E
~<ESC>%-12345X@PJL <CR><LF>
@PJL EOJ <CR><LF>
<ESC>%-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
4-8 Kernel Commands EN
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
EN Job Separation Commands 5-1
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.
5-2 Job Separation Commands EN
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"][<CR>]<LF>
Parameters:
Parameter Functional Range Default
NAME = "job name" Roman-8 characters 33
thru 255, <SP>, <HT>
N/A
START = first page 1 to 2,147,483,647 1
END = last page 1 to 2,147,483,647 Entire job
PASSWORD = number 0 to 65,535 0
DISPLAY="display text" Roman-8 characters 33
thru 255, <SP>, <HT>
N/A
EN Job Separation Commands 5-3
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 pageThe 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.)
5-4 Job Separation Commands EN
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
returns a job status message.
Note Resetting the page count associated with unsolicited page status
affects only future pages. Pages already processed, but not yet
printed, are not affected.
EN Job Separation Commands 5-5
JOB commands can be nested. For example, a spooling application
can send a PJL job that uses the JOB command to another spooler
that encapsulates the spooled job with another JOB/EOJ command
pair. When this is done, note that the job name from the outer JOB
command is cleared or overwritten by the inner command.
Example: Using the JOB Command to Print
Selected Pages
You can use the JOB command with the START and END options to
print selected pages of a job. The entire job must be sent to the
printer and formatted, but the printer does not begin printing until the
page indicated in the START option.
Note If there is a need to print more than one copy of each page, send the
job multiple times using the START and END options to print collated
copies. Using the SET command or a printer language “number of
copies” command to print multiple copies of selected pages causes
unexpected results, because the printer counts physical pages, not
multi-copy collated pages.
In this example, the JOB command:
Informs the printer of the beginning of a print job.
Names the print job “Jim's Job.
Instructs the printer to begin printing on page three of the job.
(Since the END option is missing, the job prints from page
three through the end of the job.)
Note that the name option for the JOB and EOJ commands need not
be the same. You may use different names for each.
<ESC>%-12345X@PJL <CR><LF>
@PJL JOB NAME = "Jim's Job" START = 3 <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E . . . . PCL Job . . . . <ESC>E
~<ESC>%-12345X@PJL <CR><LF>
@PJL EOJ NAME = "End of Jim's Job" <CR><LF>
<ESC>%-12345X
5-6 Job Separation Commands EN
Example: Using the JOB Command to Monitor
Job Status
This example demonstrates a PostScript print job that is spooled
before printing. The job actually consists of three separate sections
(notice the UEL commands that bound the three sectionsthe first
section does not need a closing UEL command since the printer is
already in PJL mode):
The first section is sent by the spooler. These lines name the
print job and send the USTATUS command so the spooler can
monitor job status.
The next section is a PostScript job sent to the spooler from a
software application.
The last section is sent by the spooler to end the job. When the
last page is completely printed (in the output tray), the printer
returns unsolicited status information notifying the spooler that
the job is complete.
<ESC%>-12345X@PJL <CR><LF>
@PJL COMMENT **Beginning of Job ** <CR><LF>
@PJL JOB NAME = "TF's Monitor Job" <CR><LF>
@PJL USTATUS JOB = ON <CR><LF>
<ESC>%-12345X@PJL <CR><LF>
@PJL ENTER LANGUAGE = POSTSCRIPT <CR><LF>
%!PS-ADOBE .. PostScript print job ... ^D
~<ESC>%-12345X
~<ESC>%-12345X@PJL <CR><LF>
@PJL EOJ NAME = "End of TF's Job" <CR><LF>
<ESC>%-12345X
Note If the spooler received a print job that did not use PJL (that is, the
application generated a print job that consisted of just “%!PS-ADOBE
.. PostScript print job ... ^D”, a LaserJet printer using context-sensitive
switching would still print properly (provided PostScript is installed)
and the spooler would still receive the unsolicited job status
information.
EN Job Separation Commands 5-7
Example: Nested JOB Commands
This example shows a PCL job that was sent to spooler 1, which in
turn was sent to spooler 2 (the nested jobs are indented). Note that
the first job name is overwritten by the second job name (“Spooler 1
Job”) when the second JOB command is processed.
<ESC>%-12345X@PJL <CR><LF>
@PJL JOB NAME = "Printing Job Sent From
~Spooler 2" <CR><LF>
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT Printing a PCL job <CR><LF>
@PJL JOB NAME = "Spooler 1 Job" <CR><LF>
@PJL SET RESOLUTION = 600 <CR><LF>
<ESC>%-12345X@PJL <CR><LF>
@PJL ENTER LANGUAGE = PCL <CR><LF>
<ESC>E . . PCL print job . .<ESC>E
~<ESC>%-12345X
~<ESC>%-12345X@PJL <CR><LF>
@PJL EOJ NAME = "End Spooler 1 Job" <CR><LF>
<ESC>%-12345X
~<ESC>%-12345X@PJL <CR><LF>
@PJL EOJ NAME = "End Spooler 2 Job" <CR><LF>
<ESC>%-12345X
Related Commands:
EOJ, USTATUS, DEFAULT
5-8 Job Separation Commands EN
EOJ Command
The EOJ command informs the printer that the job has completed.
Use this command whenever you use the JOB command.
Note The JOB and EOJ commands are always used in pairs. Do not use
one without the other.
Syntax:
@PJL EOJ [NAME = "job name"] [<CR>]<LF>
Parameters:
NAME = "job name" — Using the EOJ command, you can
name your print job. The job name variable is a string and must
be enclosed in double quotes as shown in the command
syntax. The job name string need not be the same name used
in the JOB command. If the NAME option is included, the
unsolicited end-of-job status includes the job name
(if unsolicited job status is enabled).
Comments:
The EOJ command marks the end of the job started with the previous
JOB command. The EOJ command:
Resets the PJL Current Environment variables to their default
(NVRAM) values, as if the printer powered down and then
powered up again.
Resets the page number associated with unsolicited
page status.
Parameter Functional Range Default
NAME = "job name" Roman-8 characters 33
thru 255, <SP>, <HT>
N/A
EN Job Separation Commands 5-9
Terminates the non-printing mode (enabled by using the
START/END options). The non-printing mode, if enabled by
the last JOB command, only applies to the previously received
data, and does not effect any future pages until another JOB
command enables the non-printing mode again.
Effect on Unsolicited Job Status
When the printer receives this command, it returns unsolicited job
status information, if enabled, when the last page of the job exits the
printer and is in the output tray. The EOJ command resets the page
number associated with unsolicited page status. Resetting the page
count associated with unsolicited page status only affects future
pages. Pages already processed, but not yet printed, are not affected.
Related Commands:
JOB, USTATUS
5-10 Job Separation Commands EN
PJL Job Security
HP LaserJet 2100 series, 4000 series, 4500 series, 5000 series,
8000 series, 8100 series, 8500 series, 4/4M Plus, 4V, 4MV, 4Si,
4SiMx, 5, 5M, 5Si, 5SiMx, 5Si Mopier, 5P, 6P, and 6MP printers
support the following types of PJL security:
Password protection of default feature settingsthis type of
security prevents applications from modifying the printer's
default feature settings unless the correct password is
specified.
Control panel lockprevents users from modifying control
panel settings using the control panel keys.
Disk lock (LaserJet 4V, 4MV, 4000 series, 5000 series,
8000 series, 8100 series, 8500 series, 5, 5M, 5Si, 5SiMx,
5Si Mopier only)—prevents writing to the printer's disk
(or flash memory).
File system initialization—for printers with a PJL file system,
the FSINIT command will not initialize the file system unless
specified in a secure job.
All types of security are set using the DEFAULT command and
queried using DINQUIRE or INQUIRE.
Password Protection of Default Feature
Settings
You can use a password to protect the printer's default features by
sending the @PJL DEFAULT PASSWORD = number command,
specifying a number between 1 and 65,535 (the 0 value disables
password protection). Once password protection is enabled, the
DEFAULT or INITIALIZE commands are disabled unless the correct
password is specified in the JOB command. Printer languages, such
as PCL and PostScript, are also prevented from changing default
variables.
Secure PJL jobs are able to use the DEFAULT and INITIALIZE
commands (or printer language commands) to set default features,
including the value of the PASSWORD, CPLOCK, and DISKLOCK
variables, until the next EOJ command is received.
EN Job Separation Commands 5-11
Control Panel Lock
You can “lock” the control panel by sending the @PJL DEFAULT
CPLOCK = ON command. When the control panel is locked, the user
cannot change any control panel settings. If the user tries to change
any control panel settings, the message “MENUS LOCKED” appears
on the control panel display for about 5 seconds. The CPLOCK
variable can only be changed from within “secure” PJL jobs (jobs with
the correct non-zero PASSWORD value in the JOB command).
For the printers that support the MINIMUM, MODERATE, and
MAXIMUM values for CPLOCK, MINIMUM locks out the RESET,
CONFIGURATION, and I/O menus. MODERATE locks out the menus
locked by MINIMUM, plus the PRINT QUALITY and PAPER
HANDLING menus. The MAXIMUM value locks out the menus locked
by MODERATE plus the PRINTING and INFORMATION menus and
the Job Cancel key (MAXIMUM has the same effect as the ON value).
Disk Lock
On printers which support Disk Lock, you can “lock” volume 0 by
sending the @PJL DEFAULT DISKLOCK = ON command. When
locked, you cannot write to volume 0 of the file system. It becomes
read-only to prevent actions such as formatting, downloading fonts to
the disk, deleting disk fonts, etc. If not locked, the disk is read/write.
The DISKLOCK variable can only be changed from within a “secure”
PJL job (a job that includes the correct, non-zero password value in
the JOB command). The DISKLOCK variable is used mainly in
networked or printer-shared configurations.
Note You can use the DINQUIRE command to check the status
of the PASSWORD, CPLOCK, and DISKLOCK variables. @PJL
DINQUIRE PASSWORD returns ENABLED or DISABLED, @PJL
DINQUIRE CPLOCK returns OFF or ON, and @PJL DINQUIRE
DISKLOCK returns OFF or ON. You do not have to be in a secure job
to use the DINQUIRE command to check these variables.
5-12 Job Separation Commands EN
Example: Using PJL Security
This example demonstrates how to set a password and to lock the
control panel so users cannot modify control panel settings. It is
assumed the password value at the start of job is 7654. The example
changes the password to 1776.
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT **Set Password** <CR><LF>
@PJL COMMENT **& Lock Control Panel**<CR><LF>
@PJL JOB PASSWORD = 7654 <CR><LF>
@PJL DEFAULT PASSWORD = 1776 <CR><LF>
@PJL DINQUIRE PASSWORD <CR><LF>
@PJL DEFAULT CPLOCK = ON <CR><LF>
@PJL DINQUIRE CPLOCK <CR><LF>
@PJL EOJ <CR><LF>
<ESC>%-12345X
To unlock the control panel, you would send a job similar to the
following job. This job specifies the correct password with the JOB
command, and then uses the DEFAULT command to unlock the
control panel.
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT **Unlock Control Panel** <CR><LF>
@PJL JOB PASSWORD = 1776 <CR><LF>
@PJL DEFAULT CPLOCK = OFF <CR><LF>
@PJL DINQUIRE CPLOCK <CR><LF>
@PJL EOJ <CR><LF>
<ESC>%-12345X
To write to volume 0 of the file system, you would send a job like the
following. This job specifies the correct password with the JOB
command, and then uses the DEFAULT command to unlock, and then
later to lock the disk.
<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT **Unlock Volume 0** <CR><LF>
@PJL JOB PASSWORD = 1776 <CR><LF>
@PJL DEFAULT DISKLOCK = OFF <CR><LF>
@PJL DINQUIRE DISKLOCK <CR><LF>
@PJL ENTER LANGUAGE = POSTSCRIPT <CR><LF>
%!PS-ADOBE . . . PostScript print job . . . ^D
~<ESC>%-12345X@PJL <CR><LF>
@PJL COMMENT **Lock Volume 0** <CR><LF>
@PJL DEFAULT DISKLOCK = ON <CR><LF>
@PJL DINQUIRE DISKLOCK <CR><LF>
@PJL EOJ <CR><LF>
<ESC>%-12345X
EN Job Separation Commands 5-13
Job Cancellation
HP LaserJet 2100 series, 4000 series, 4500 series, 5000 series,
8000 series, 8100 series, 8500 series, 5, 5M, 5Si, 5SiMx printers and
the LaserJet 5Si Mopier support job cancellation using the printer
control panel. When a PJL print job is started using the PJL JOB
command as described in this chapter, the following PJL information
can be obtained from the printer:
Start of job notification
End of job notification
Job cancellation unsolicited status
Each of these pieces of information is described below.
Start of Job Notification
If unsolicited job status is enabled when the printer begins processing
the PJL job, the printer responds to the PJL JOB command with an
@PJL USTATUS JOB START response. If job ID reporting is enabled
by sending @PJL SET JOBID=ON, the printer response includes a
job ID number that is associated with the job name supplied in the
JOB command.
For example, if the printer receives the following command:
@PJL JOB NAME = "job name"
If unsolicited job status and job ID reporting are enabled, the printer
would generate an ID number (such as 346) and respond with:
@PJL USTATUS JOB<CR><LF>
START<CR><LF>
NAME="job name"<CR><LF>
ID=346<CR><LF>
<FF>
The printer-generated ID number can range in value from 0 to 32767.
Job ID numbers are unique until they roll over to zero or until the
printer power is cycled (at which time the ID defaults to 0).
5-14 Job Separation Commands EN
End of Job Notification
Near the end of the PJL job, the application should send the EOJ
command as described in this chapter. If unsolicited job status is
enabled when the last page of the job is delivered to the output bin,
the printer responds to the EOJ command with an @PJL USTATUS
JOB END response. If JOB ID reporting is enabled, the response
includes a printer-generated ID number associated with the PJL job
name provided in the EOJ command. The response also contains a
RESULT field. All possible values for the RESULT are shown in the
following table:
Using the previous example, if the printer receives the following
command containing the same job name as in the JOB command:
@PJL EOJ NAME = "job name"
If unsolicited job status and job ID reporting are enabled, the printer
would use the ID number associated with that job name and respond
with:
@PJL USTATUS JOB<CR><LF>
END<CR><LF>
NAME="job name"<CR><LF>
PAGES=123<CR><LF>
ID=346<CR><LF>
RESULT=OK
<FF>
If the job had been cancelled instead of completed, the printer would
respond with the same message except the RESULT value would be
different.
RESULT Value Description
OK The last page of the job was sent
to the output bin.
USER_CANCELED The job was canceled from the
control panel.
HOST_CANCELED The job was canceled from a host
system.
RESOURCE_CANCELED The job was canceled because a
resource was not available (for
example, the media was not
loaded).
EN Job Separation Commands 5-15
Job Cancellation Unsolicited Status
As soon as the printer receives notification that a job is cancelled, the
printer provides the @PJL USTATUS JOB CANCELED message to
the driver/spooler if unsolicited job status is enabled. Using the same
job name and ID number as the previous example, the printer's
response would be:
@PJL USTATUS JOB<CR><LF>
CANCELED<CR><LF>
NAME="job name"<CR><LF>
ID=346<CR><LF>
RESULT=USER_CANCELED
<FF>
The job name provided in the NAME option of the PJL USTATUS JOB
CANCELED response is the current job name if a current job name is
available. The current job name is the job name retained in the printer
at the time the last PJL JOB command was processed. The current
job name could also have been supplied and/or modified using
PostScript.
If a job name is supplied in the EOJ command and if unsolicited job
status is enabled at the time the EOJ command is parsed, the NAME
option of the PJL USTATUS JOB CANCELED response will contain
the job name assigned in the EOJ command. Otherwise, the NAME
line is eliminated from the response.
5-16 Job Separation Commands EN
EN Environment Commands 6-1
6
Environment
Commands
Introduction
Hewlett-Packard printers have many features you can set using
printer commands or by pressing control panel keys. Since previous
jobs can change feature settings to unwanted values, applications
should set printer features affecting the print job to a desired state at
the beginning of the job.
Setting features to a desired state is easily accomplished using a
combination of PJL and printer language commands. This chapter
describes sets of printer features known as print environments, and
the PJL commands you use to set printer features to a desired state,
such as:
DEFAULT sets the default value for environment variables,
storing these values in non-volatile RAM.
INITIALIZE resets the current and default PJL variables to the
factory default values.
RESET resets the current PJL variables to the default values.
•SET sets an environment variable to a specified value until the
next PJL reset condition.
Note For a list of default feature settings, see Appendix A.
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.
6-2 Environment Commands EN
Print Environments
At any time during printer operation, the printer's current feature
settings are referred to collectively as the print environment. When
certain printer events occur, such as the incidence of a printer
language reset, RESET command, or other PJL reset condition, the
print environment settings can default to the settings of other stored
environments.
The printer constantly maintains four environments, which are listed
below in priority order:
Factory Default Environment (lowest priority)
User Default Environment
PJL Current Environment
Modified Print Environment (highest priority)
The Factory Default Environment holds the initial feature values set at
the factory, which can be used for default values when a complete
reset is needed. The User Default Environment holds the settings
modified with the DEFAULT command, or set from the control panel.
The print environment defaults to the User Default values when
various printer conditions occur, such as the end of a PJL job, a PJL
reset condition, or when certain PJL commands are executed. The
PJL Current Environment contains the current PJL feature settings.
When a printer language is entered or a new job begins, the PJL
Current Environment settings are loaded into the Modified Print
Environment, providing a base feature set which the application can
modify if needed. After a printer language is entered, feature settings
are recorded in the Modified Print Environment.
Note HP LaserJet 4L, 5L, 6L, and 1100 series printers do not have
NVRAM. The PJL Default and Current Environment settings are
stored in RAM and are reset to the factory default values during a
power cycle.
Each environment is explained in more detail below:
Factory Default Environment — This environment consists
of a group of feature settings that are permanently stored in
the printer. The printer uses these settings when it is powered
on for the first time after leaving the factory, and after the
INITIALIZE command is received.
EN Environment Commands 6-3
User Default EnvironmentThis environment contains the
values that are set using the DEFAULT command or the
control panel keys. These values are stored in non-volatile
RAM (in those printers containing NVRAM). Following any PJL
reset condition, these values are placed into the PJL Current
Environment. If the printer has a control panel, the User
Default values are displayed on the control panel under the
appropriate menu.
PJL Current Environment This environment contains the
current PJL feature settings. Current settings are based on the
User Default values and any settings modified using the SET
command. These values default to the User Default values
when a PJL reset condition occurs.
Modified Print Environment This environment is active as
soon as a printer language is entered. At that time, the PJL
Current Environment values are loaded into the Modified Print
Environment and act as a base set of features. Printer
language commands then are used to modify feature settings
to the desired state. The PJL Current Environment settings are
loaded into the Modified Print Environment whenever a
personality is activated or a reset is received, including any
printer language reset or PJL reset condition.
Figure 6-1 illustrates how the environments interact, and how they
affect the modified print environment.
6-4 Environment Commands EN
Figure 6-1 How Environments Affect the Print Job
EN Environment Commands 6-5
Changing Environment Settings
The following scenario elaborates on how the print environment
changes during printer operation. The “number of copies” feature is
used to show feature changes as events occur.
1 The first time the printer is turned on after it leaves the factory (or
after the INITIALIZE command), the number of copies feature is
set to the factory default value of 1 copy.
2 At any point following the initial power-on or the INITIALIZE
command, the number of copies feature can be set using the
DEFAULT COPIES command in a PJL job or by changing the
COPIES = setting on the control panel. This changes the User
Default Environment setting to a new value, such as number of
copies = 3. The User Default Environment values are not loaded
into the PJL Current Environment until the next PJL reset
condition occurs. (For printers with control panels, if the printer is
currently not processing a job while the feature is changed from
the control panel, the printer treats the feature change as a PJL
reset condition and loads the newly changed value into
non-volatile RAM.)
3 If the PJL job uses the SET COPIES = 5 command to change the
number of copies, the PJL Current Environment value changes to
the selected setting (for example, 5). Otherwise, the number of
copies setting remains the same as set using the DEFAULT
command or the control panel (in this example, 3).
4 If the printer language (such as PCL or PostScript) changes the
number of copies setting to another value, such as 8, the newly
specified printer language value overrides the PJL Current
Environment value. If the printer has a control panel, however, it
still displays the User Default Environment value set using the
control panel keys or the DEFAULT command (3).
5 The next PJL reset condition defaults the number of copies
setting to the value set from the control panel or by using the
DEFAULT command (User Default Environment). In this example,
the number of copies feature setting then defaults to 3 after a PJL
reset condition.
All other features operate similarlyif any feature is not modified by a
higher priority action, it keeps its current value setting.
6-6 Environment Commands EN
Example: Changing Environment Settings
This example shows the values stored in the different environments
when commands are issued. The example begins with the number of
copies set to 1 in all environments (the Factory Default Environment
setting). The table reflects the current settings after each command.
Environment Summary
As indicated previously, each print environment differs in relation to
how it is stored, how the settings are changed, and how the PJL
Current Environment can be defaulted. The table on the following
page summarizes the characteristics of each print environment. For
those printers without a control panel, disregard any mention of
control panels. In these printers, User Default Environment features
are controlled using just the DEFAULT command.
Note See Appendix A for a list of environment variables supported by each
PJL printer.
Command Sent
Environment Setting
Factory
Default
User
Default
PJL
Current
Modified
Print
After PJL INITIALIZE or RESET
MENU
1111
@PJL DEFAULT COPIES=3 1311
@PJL SET COPIES = 4 1344
@PJL ENTER
LANGUAGE=PCL<LF>
<ESC>&l5X
1345
<ESC>%-12345X 1333
EN Environment Commands 6-7
Factory Default
Environment
Stored permanently in printer memorysettings cannot be modified.
Factory default settings cannot be read programmatically, but they are listed in the
PCL 5 Comparison Guide.
User Default
Environment
The User Default Environment is set to the factory default values when the printer
initially is powered onbefore printer commands are sent from an application or any
control panel settings are changed.
Stored in non-volatile RAM in printers that have itcan be changed using the
DEFAULT command or control panel keys.
The INITIALIZE command loads the Factory Default settings into the User Default
Environment.
User default settings can be read using the DINQUIRE command.
PJL Current
Environment
Any PJL reset condition loads the User Default Environment feature settings into the
PJL Current Environment.
Always reflects the PJL-level settings currently in use.
Stored in RAMcan be changed using SET command. These values override
feature settings until the next PJL reset condition.
The INITIALIZE command loads the Factory Default settings into the PJL Current
Environment.
PJL Current Environment settings can be read using the INQUIRE command.
Modified Print
Environment
(Printer-
Language
Specific)
Active as soon as printer receives any printer language commands (such as PCL or
PostScript commands). This environment contains all of the feature settings
currently in effect at any point after a printer language is entered.
Printer language resets (such as the <ESC>E command in PCL), any printer
language switch, or the ENTER command load the PJL Current Environment into
the Modified Print Environment.
Stored in RAMcan be changed using printer language commands (PCL,
PostScript, and others). The printer language values override any PJL Current
Environment feature for the duration of the printer language job (until the printer
language is changed or a printer language-specific reset is executed).
The Modified Print Environment settings can be read if the active printer language
supports this capability.
6-8 Environment Commands EN
PJL Reset Conditions
EN Environment Commands 6-9
“PJL reset conditions” are listed below. Note that PJL reset conditions
differ from printer language resets (such as <ESC>E). Printer
language resets load the PJL Current Environment values into the
Modified Print Environment. PJL reset conditions are more powerful.
They load the User Default values into the PJL Current Environment,
and also into the Modified Print Environment.
In this document, the term PJL reset condition refers to any of the
following events:
•Power-on
UEL command (when not between a JOB and EOJ command
pair)
@PJL INITIALIZE command
@PJL RESET command
@PJL JOB or EOJ command
Control panel reset
Other printer-specific events (see Appendix A for information
about job boundaries)
6-10 Environment Commands EN
Key Points to Remember About Environments
When using PJL to set the printer to a desired state, remember the
following points.
At the beginning of a PJL job, the current feature settings are
the same as the control panel values or those features set with
the DEFAULT command.
When a printer language is entered, the current feature
settings (Modified Print Environment) become the same as the
PJL Current Environment. From this starting point, the printer
language commands modify the feature settings. Printer
language commands override all other settings.
The PJL Current Environment settings can be changed using
the SET command. These settings take effect until the next
PJL reset condition. Note that since the JOB command causes
a reset condition, the SET command should always be used
after the JOB command.
The control panel settings (User Default Environment) can be
changed using the control panel or the DEFAULT command. In
printers without a control panel, the default settings are
modified with only the DEFAULT command.
The Modified Print Environment settings are changed using
printer language commands. These settings take effect for the
duration of the printer language job. After a printer
language-specific reset, such as <ESC>E for PCL, the PJL
Current Environment feature settings are loaded into the
Modified Print Environment.
If the SET command is used in a PJL job, always use the PJL
RESET command after the job is completed.
EN Environment Commands 6-11
PJL Environment Variables
This section lists the PJL environment variables. General PJL
environment variables (those not printer language-specific) are listed
first, followed by printer language-specific variables. For most
variables except the read-only variables, value settings can be
modified using the following commands:
SET — sets PJL Current Environment settings that remain
active until the next “PJL reset condition” (e.g. JOB, EOJ,
RESET, INITIALIZE commands—see page 6-8).
RESET — the PJL RESET command defaults the PJL Current
Environment to the User Default Environment (feature settings
set with the DEFAULT command or the control panel keys).
DEFAULT — modifies the User Default settings (stored in
NVRAM in those printers containing NVRAM).
INITIALIZE — defaults all environments to the Factory Default
settings.
You can request value settings for printer features using the following
two commands:
INQUIRE — requests the PJL Current Environment settings.
DINQUIRE — requests the User Default (control panel)
settings.
(The INQUIRE and DINQUIRE commands are discussed in
Chapter 7.)
Note Whenever possible, use printer language commands to set printer
features. Use PJL commands only when there are no printer
language commands available for a desired feature.
When setting printer features with PJL, use the SET and RESET
commands if you want to affect the current PJL job only. Using the
DEFAULT and INITIALIZE commands affects the current job and
succeeding jobs (these commands should only be used when you
require a command that affects more than just the current job).
6-12 Environment Commands EN
General PJL Environment Variables
The following table lists the PJL environment variables that are not
printer language-specific. When you use these variables, do not use
the LPARM : personality option. The range of values for each variable
may differ for the various printer models. Appendix A lists the
environment variables and indicates which printers support each
variable. Another method of obtaining a list of valid variables and the
range of values for each variable is to send the INFO VARIABLES
command to request this information directly from the printer. See the
INFO command in Chapter 7 for more information. You can find
valuable information about environment variables in the control panel
sections of the user's manual for each printer.
Note Some environment variables can be modified using the DEFAULT
command but not the SET command, some can be SET but not
modified using DEFAULT, and some are read only variables.
Appendix A lists environment variables, including read only variables,
for all of the PJL printers.
General PJL Environment Variables
Variable Description
Sample Value
Range
AUTOCONT Returns the autocontinue configuration. ON, OFF
AUTOSELECT Sets the default media tray autoselect
feature of the printer.
ON, OFF
BINDING Sets the default relationship of the front
and back images on pages printed in
duplex.
LONGEDGE,
SHORTEDGE
EN Environment Commands 6-13
BITSPERPIXEL For PCL 6 only, this variable controls
the number of bits per pixel used when
printing grayscale or color images. The
valid values are dependent on the
current setting of RESOLUTION. If
RESOLUTION is 300 or 1200, the only
valid BITSPERPIXEL value is 1. If
RESOLUTION is 600, the only valid
BITSPERPIXEL values are 1 and 2. For
FastRes 1200 printing, first set the
RESOLUTION to 600 and then set
BITSPERPIXEL to 2. For ProRes 1200,
first set the RESOLUTION to 1200 and
then set BITSPERPIXEL to 1.
2, 1
CLEARABLE-WARNIN
GS
Returns the configuration for displaying
clearable warnings (non-fatal error
messa