HP Printer Job Language Technical Reference Manual

Page 1
Printer Job Language Technical Reference Manual
Edition 10 E1097
HP Part No. 5021-0380 Printed in U.S.A. 10/97
Page 2
Notice
The information contained in this document is subject to change without notice. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO
THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett­Packard shall not be liable for errors contained herein or for incidental consequential dam­ages in connection with the furnishing, performance, or use of this material.
This document contains proprietary information which is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced, or translated with­out the prior written consent of Hewlett-Packard Company.
Copyright © 1997 by HEWLETT-PACKARD CO.
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 Com­puter Corporation. Bi-Tronics and HP Explorer Software are trademarks 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 trade- mark 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 regis­tered 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 WordPerfect Corporation.
First Edition September 1992 (P/N 5961-0512) Second Edition — May 1993 (P/N 5961-0998) Third Edition — July 1993 (P/N 5961-0603) Fourth Edition — May 1994 (P/N 5961-0636) Fifth Edition — September 1994 (P/N 5961-0704) Sixth Edition — May 1995 (P/N 5010-3996) Seventh Edition — October 1995 (P/N 5010-3999) Eighth Edition — May 1996 (P/N 5961-0938) Ninth Edition — October 1996 (P/N 5021-0328) Tenth Edition — October 1997 (P/N 5021-0380)
ii
Page 3
Inside This Manual
What You Can Learn
From This Manual
Application Developers
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 10. In addition, users of this manual should be acquainted with the HP LaserJet printer language (PCL) and with LaserJet printer features.
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.
iii
Page 4
Manual Organization
This manual is comprised of ten 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 9 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 HP LaserJet printers, HP DeskJet printers, and HP DesignJet plotters and printers.
Chapter 2. PJL Command Syntax and Format
Chapter 2 explains the conventions used to describe PJL command syntax. The chapter also explains the formats that PJL commands follow and describes what happens when the printer receives an illegal command.
Chapter 3. Using PJL
This chapter explains how PJL commands are used, including the requirements of a PJL job and examples showing basic PJL command structure. In addition, the chapter categorizes the PJL commands in this manual by their functionality, along with a brief command summary.
Chapter 4. Kernel Commands
This chapter explains the three core commands used in most PJL jobs: the Universal Exit Language (UEL) command, the COMMENT command, and the ENTER command. The chapter also describes the related topics of implicit and explicit printer language switching.
iv
Page 5
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, FSDOWN­LOAD, 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. Programming Tips
This chapter demonstrates how to create well-formed jobs and discusses common problems and things to watch for
v
Page 6
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. 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.
Quick Index
The inside back cover shows an alphabetical listing of each PJL command, with accompanying page numbers for accessing information about specific commands.
vi
Page 7
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.
vii
Page 8
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.
viii
Page 9
Contents
Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Manual Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
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-2
Some Sample PJL Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
What’s Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Command Groupings by Functionality . . . . . . . . . . . . . . 3-5
4 Kernel Commands
Universal Exit Language (UEL) Command. . . . . . . . . . . 4-2
ENTER Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
COMMENT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Methods of Printer Language Switching . . . . . . . . . . . . . 4-8
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-10
Disk Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
Contents-1
Page 10
Job Cancellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
Start of Job Notification . . . . . . . . . . . . . . . . . . . . . . . . 5-14
End of Job Notification . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
Job Cancellation Unsolicited Status . . . . . . . . . . . . . . 5-16
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-9
PJL Environment Variables . . . . . . . . . . . . . . . . . . . . . . . 6-10
General PJL Environment Variables. . . . . . . . . . . . . . 6-11
Port-Specific Variables (LaserJet 4PJ Only) . . . . . . . . 6-22
PCL-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . . . 6-23
PostScript-Specific Variables . . . . . . . . . . . . . . . . . . . . 6-27
ESC/P-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . 6-28
Setting the Printer to a Desired State. . . . . . . . . . . . . . . 6-30
DEFAULT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
INITIALIZE Command. . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36
RESET Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39
SET Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42
7 Status Readback Commands
Printer Status Requirements . . . . . . . . . . . . . . . . . . . . . . . 7-2
Synchronizing Status Readback Responses . . . . . . . . . . . 7-2
Format of Status Readback Responses . . . . . . . . . . . . . . . 7-3
INQUIRE Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
DINQUIRE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
ECHO Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
INFO Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
USTATUS Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
USTATUSOFF Command. . . . . . . . . . . . . . . . . . . . . . . . . 7-43
Job Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
Sending the Initial Job . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
After Job Failure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
Contents-2
8 Device Attendance Commands
RDYMSG Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
OPMSG Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
STMSG Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Page 11
9 PJL File System Commands
FSAPPEND Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
FSDIRLIST Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
FSDELETE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
FSDOWNLOAD Command. . . . . . . . . . . . . . . . . . . . . . . . 9-7
FSINIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
FSMKDIR Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
FSQUERY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
FSUPLOAD Command . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
File System Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
10 Programming Tips for Using PJL
PJL Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Print Data Generators. . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Printer Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5
Spoolers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Requesting Printer Status . . . . . . . . . . . . . . . . . . . . . . 10-18
Using Status Readback in a Multi-User System . . . . . 10-18
A Product-Specific Feature Support
PJL Feature Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
PJL Environment Variable Support . . . . . . . . . . . . . . . . . A-5
HP LaserJet IIISi Comments . . . . . . . . . . . . . . . . . . . . . A-28
Comments about HP LaserJet Printers. . . . . . . . . . . . . A-29
LaserJet Printers With Reduced- Function
Control Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-35
Color LaserJet Printer Comments . . . . . . . . . . . . . . . . . A-36
HP DeskJet 1200C
and 1600C Printer Family Comments . . . . . . . . . . . . . . A-36
HP LaserJet 5Si/ 5SiMx/5Si Mopier Comments . . . . . . A-40
HP LaserJet 5Si Mopier Comments. . . . . . . . . . . . . . . . A-41
HP LaserJet 4000 Series Comments . . . . . . . . . . . . . . . A-43
Contents-3
Page 12
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 T ray Status (12xyy). . . . . . . . . . . . D-6
Output Bin Status (15xxy) . . . . . . . . . . . . . . . . . . . . . . D-6
PJL Parser Errors (20xxx) . . . . . . . . . . . . . . . . . . . . . . D-7
PJL Parser Warnings (25xxx). . . . . . . . . . . . . . . . . . . . D-8
PJL Semantic Errors (27xxx) . . . . . . . . . . . . . . . . . . . . D-9
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-18
Paper Jam Messages (42xyy—LJ 5Si/5SiMx only) . . D-20
Optional Paper Handling Device Messages (43xyy) . D-22
LaserJet 4000 Series Paper Jam Messages (44xyy) . D-23
Hardware Errors (50xxx) . . . . . . . . . . . . . . . . . . . . . . D-24
Glossary
Contents-4
Index
Quick Index
Page 13
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
1
Introduction to PJL 1-1
Page 14
Figure 1-1. PJL Resides Above Other Printer Languages
Note Some HP printers, such as the LaserJet 4L, 5L, or 6L
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 6L printer. 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.
1-2 Introduction to PJL
Page 15
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.
Introduction to PJL 1-3
Page 16
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 4000 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 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.
PCL Jobs When non-PJL printers receive PCL jobs, any PJL
1-4 Introduction to PJL
Note For best results, do not send PJL commands to a non-PJL
printer.
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,
Page 17
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.
Introduction to PJL 1-5
Page 18
1-6 Introduction to PJL
Page 19
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.
2
PJL Command Syntax and Format 2-1
Page 20
Syntax Conventions
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, “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].
The following syntax conventions are used to describe the PJL commands in this manual:
2-2 PJL Command Syntax and Format
Page 21
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.
PJL Command Syntax and Format 2-3
Page 22
Format of PJL Commands
Format #1 <ESC>%–12345X
Format #2 @PJL [<CR>]<LF>
All PJL command lines follow one of the following four formats. Each format defines how commands using that format are structured.
The only command that uses this format is the Universal Exit Language (UEL) command.
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
The COMMENT and ECHO commands currently are the only PJL commands using format number 3.
Format #4 @PJL
option name
~ [
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 LP ARM 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 [LPARM : personality]|[IPARM : port] ~ variable = value [<CR>] <LF>, you can use either the LPARM command modifier or the IPARM command modifier, but not both.
command
command [command modifier
[<words>] [<CR>]<LF>
[=
value
]] [<CR>]<LF>
:
value
]
2-4 PJL Command Syntax and Format
Page 23
[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 DEF AULT 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 = "
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.
message
" [<CR>]<LF>
PJL Command Syntax and Format 2-5
Page 24
The placement of white space in PJL commands depends on its location within the command. Some white space is required and some is optional:
White space is required between the @PJL prefix and the PJL command name, and between the PJL command name and command modifiers. For example:
@PJL OPMSG DISPLAY or @PJL ENTER LANGUAGE =
personality
If white space is shown in any other place in the command, it is optional (see the examples below).
If white space is not shown between two portions of a command, white space is not allowed. An example is between the optional carriage return and required line feed character that terminate most commands.
For clarity, this manual consistently shows white space as one blank space. The PJL language requirements are shown in both examples below:
2-6 PJL Command Syntax and Format
Page 25
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.
PJL Command Syntax and Format 2-7
Page 26
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)
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)
Note Strings displayed on the printer control panel are generally
2-8 PJL Command Syntax and Format
"This is also not<CR>valid."
(<CR> is not within the valid range of characters for a string.)
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.
Page 27
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.
PJL Command Syntax and Format 2-9
Page 28
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>
Note Any errors that occur during PJL parsing can be received
by enabling device status as described in Chapter 7 (send the @PJL USTATUS DEVICE = VERBOSE command). Appendix D lists the status codes that are received by the host when an invalid command is received and unsolicited verbose device status is enabled.
2-10 PJL Command Syntax and Format
Page 29
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 six 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.
3
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.)
PJL Code PCL Job PJL Code PostScript Job PJL Code
Figure 3-1. PJL Commands Encapsulate Print Jobs
Using PJL 3-1
Page 30
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.
3-2 Using PJL
<ESC>%–12345X@PJL <CR><LF> <ESC>%–12345X@PJL COMMENT *Start Job* <CR><LF>
Page 31
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
Example: Switching
Printer Languages
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
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
Using PJL 3-3
Page 32
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 10 (Programming Tips), 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.
3-4 Using PJL
Page 33
Command Groupings by Functionality
Command Group Command Command Description
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.
Kernel Commands (Chapter 4)
Job Separation Commands (Chapter 5)
Environment Commands (Chapter 6)
Universal Exit Language (UEL)
COMMENT Causes PJL to accept the
ENTER Selects a printer language for
JOB Informs printer of the start of a
EOJ Tells printer the print job is
DEFAULT Sets default value for environment
SET Sets an environment variable to a
INITIALIZE Resets current and default PJL
Exits current printer language and returns control to PJL.
command line as a comment.
processing the current job.
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.
complete, resets the page count.
variables.
specified value for the duration of a PJL job.
variables to factory default values.
RESET Resets current PJL variables to
default values.
Using PJL 3-5
Page 34
Command Group Command Command Description
Status Readback Commands (Chapter 7)
Device Attendance Commands (Chapter 8)
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. RDYMSG Specifies a message that replaces
the READY message on the
printer control panel. Does not
affect online state.
3-6 Using PJL
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.
Page 35
Command Group Command Command Description
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.
Using PJL 3-7
Page 36
3-8 Using PJL
Page 37
Kernel Commands
Introduction This chapter explains the following three PJL commands:
Universal Exit Language (UEL) command exits the current printer language and returns control to PJL.
ENTER command selects a printer language for processing the current job.
COMMENT command enables developers to add comments to their PJL commands.
Together, these commands provide a minimum set of tools necessary to implement job control. These commands allow applications to set job boundaries, add comments, and programmatically select printer languages.
Besides programmatic printer language switching, you can configure some LaserJet printers to switch printer languages automatically between print jobs. Following the descriptions of the UEL, ENTER, and COMMENT commands, this chapter describes the different methods used to switch printer languages.
4
Kernel Commands 4-1
Page 38
Universal Exit Language (UEL) Command
Syntax: <ESC>%-12345X
Parameters: The UEL command does not use any parameters.
Comments: The UEL command is a data stream sequence recognized
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.
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.
4-2 Kernel Commands
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
Page 39
(if PERSONALITY =AUTO, the data stream is sampled for context-sensitive switchingsee 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
Kernel Commands 4-3
Page 40
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 =
Parameters:
* Other personalities might be supported.
personality — The personality variable must be set to PCL, POSTSCRIPT, ESCP, or one of the other supported personalities. Personalities besides PCL and PostScript can be added to some printers by plugging in additional hardware, such as cartridges or ROM SIMMs. If your application handles status readback, you can request a list of all valid personalities present in the prin ter (see the “INFO CONFIG” section in Chapter 7).
Parameter Range
personality PCL, POSTSCRIPT, ESCP,
personality
Others *
[<CR>]<LF>
Comments: The ENTER command must be positioned immediately
before any personality-specific data. The selected personality begins parsing immediately after the <LF> that terminates in 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, LaserJet 4, 4M, 4 Plus, 4M Plus, 4Si, 4SiMx, 4000 series, 5Si, 5Si MX, 5Si Mopier , 4ML, 4P, 4MP, 4V, 4MV, 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).
4-4 Kernel Commands
Page 41
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
Kernel Commands 4-5
Page 42
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
Parameters:
Parameter Range
remarks
remarks Roman-8 character codes
[<CR>]<LF>
33 through 255 and <WS>, starting with a printable character.
Comments: The COMMENT command is useful for documenting lines
of PJL commands. Comments may be placed anywhere in the PJL code between the initial UEL command and the ENTER command. (Comments placed after the ENTER command are considered personality-specific data and are printed as determined by the active printer language.)
Like other PJL commands, the COMMENT command is terminated by a line feed character. You cannot extend comments onto the next line. Comments longer than one line require a separate COMMENT command for each line.
See the following page for an example demonstrating the use of the COMMENT command.
4-6 Kernel Commands
Page 43
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> @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
Kernel Commands 4-7
Page 44
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, 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 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.
4-8 Kernel Commands
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.
Page 45
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
Kernel Commands 4-9
Page 46
4-10 Kernel Commands
Page 47
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.
5
Job Separation Commands 5-1
Page 48
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 LaserJet 4000 series printers, 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.
Syntax: @PJL JOB [NAME = "
Parameters:
5-2 Job Separation Commands
job name
~[END = ~[DISPLAY = "
NAME = "job name" Roman-8 characters
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
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
last page
Parameter Functional Range Default
][PASSWORD =
display text
33 thru 255, <SP>, <HT>
33 thru 255, <SP>, <HT>
"][START=
first page
number ]
"][<CR>]<LF>
N/A
N/A
]
Page 49
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.
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 DEFAUL T 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 DEFAUL T 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 Security” section at the end of this chapter.)
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
Job Separation Commands 5-3
Page 50
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 printer, 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/51). For LANG=TURKISH, the display is in Latin 5 (ISO 8859/9).
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.
Note Resetting the page count associated with unsolicited page
5-4 Job Separation Commands
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.
status affects only future pages. Pages already processed, but not yet printed, are not affected.
Page 51
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
Note If there is a need to print more than one copy of each page,
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.
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
Job Separation Commands 5-5
Page 52
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
5-6 Job Separation Commands
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.
Page 53
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
Job Separation Commands 5-7
Page 54
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 = "
Parameters:
Parameter Functional Range Default
NAME = "job name" Roman-8 characters
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).
job name
33 thru 255, <SP>, <HT>
"] [<CR>]<LF>
N/A
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.
5-8 Job Separation Commands
Page 55
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
Job Separation Commands 5-9
Page 56
PJL Job Security HP Laser J e t 4 / 4M P l u s , 4 V, 4MV, 4Si, 4 S iM x, 4000 series,
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, 5, 5M, 5Si, 5SiMx, 5Si Mopier only)—prevents writing to the printer’s disk (or flash memory [LaserJet 5/5M printer]).
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
5-10 Job Separation Commands
You can use a password to protect the printer’s default features by sending the @PJL DEFAULT P ASSWORD = number command, specifying a number between 1 and 65,535 (the 0 value disables password protection). Once password protection is enabled, the DEF AULT 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.
Page 57
Control Panel Lock You can “lock” the control panel by sending the @PJL
DEF AULT 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 P ASSWORD 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.
Job Separation Commands 5-11
Page 58
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
5-12 Job Separation Commands
Page 59
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
Job Separation Commands 5-13
Page 60
Job Cancellation HP LaserJet 4000 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 = "
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=" 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).
job name
job name
"<CR><LF>
"
5-14 Job Separation Commands
Page 61
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:
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).
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>
Job Separation Commands 5-15
Page 62
If the job had been cancelled instead of completed, the printer would respond with the same message except the RESULT value would be different.
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=" 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.
job name
"<CR><LF>
5-16 Job Separation Commands
Page 63
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:
DEFAUL T 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.
6
Note For a list of default feature settings, see Appendix A.
Environment Commands 6-1
Page 64
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, and 6L printers do not have NVRAM.
6-2 Environment Commands
The PJL Default and Current Environment settings are stored in RAM and are reset to the factory default values during a power cycle.
Page 65
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.
User Default Environment — This 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.
Environment Commands 6-3
Page 66
Figure 6-1. How Environments Affect the Print Job
6-4 Environment Commands
Page 67
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 DEFAUL T COPIES command in a PJL job or by changing the COPIES = setting on the control panel. This changes the User Default Environment set­ting 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 condi­tion 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 Environ­ment 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 con­trol 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 cop­ies setting to the value set from the control panel or by
Environment Commands 6-5
Page 68
using the DEFAULT command (User Default Environ­ment). In this example, the number of copies feature set­ting 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.
Example: Changing
Environment Settings
Command Sent Environment Setting
After PJL INITIALIZE or RESET MENU 1 1 1 1
@PJL DEFAULT COPIES=3 1311 @PJL SET COPIES = 4 1344 @PJL ENTER LANGUAGE=PCL<LF>
<ESC>&l5X <ESC>%-12345X 1333
Environment
Summary
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.
Factory
Default
1345
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.
User
Default
PJL
Current
Modified
Print
Note See Appendix A for a list of environment variables
6-6 Environment Commands
supported by each PJL printer.
Page 69
Factory Default Environment
User Default Environment
PJL Current Environment
Modified Print Environment
(Printer­Language Specific)
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. 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. 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. 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.
Environment Commands 6-7
Page 70
PJL Reset Conditions
“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-8 Environment Commands
Page 71
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 DEFAUL T 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.
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 DEFAUL T 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.
Environment Commands 6-9
Page 72
PJL Environment V ariables
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.
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
6-10 Environment Commands
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).
Page 73
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.
BINDING Sets the default relationship of the front and
back images on pages printed in duplex.
ON, OFF
LONGEDGE, SHORTEDGE
Environment Commands 6-11
Page 74
General PJL Environment Variables
Variable Description Sample Value
Range
BITSPERPIXEL For PCL 6 only, this variable controls the
2, 1 number of bits per pixel used when printing grayscale or color images. The valid values are dependent on the current setting of RESOLU­TION. If RESOLUTION is 300 or 1200, the only valid BITSPERPIXEL value is 1. If RESOLUTION is 600, the only valid BITSPER­PIXEL 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.
CLEARABLE­WARNINGS
Returns the configuration for displaying clearable warnings (non-fatal error messages
JOB, ON cleared by pressing the Continue key.) If the
value is set to JOB, then clearable warnings generated by a job are displayed only until the start of the next job. If the value is ON, then clearable warnings are displayed until the user presses the Continue key.
CONTEXT­SWITCH
Enables/disables the use of implicit personality switching. If a job is sent without an ENTER
ON, OFF LANGUAGE command, the printer looks for
context clues to determine which personality takes effect. When the personality is changed, memory is reconfigured and all downloaded fonts, PCL macros, and PostScript dictionaries are lost (however, no I/O data is lost).
COPIES Number of uncollated copies for each page of
1 to 999 the job.
COURIER Sets the version of the Courier font. REGULAR, DARK
6-12 Environment Commands
Page 75
General PJL Environment Variables
Variable Description Sample Value
CPLOCK Sets the default control panel lockout state. If
CPLOCK is set to ON, users cannot modify feature settings using the control panel keys. CPLOCK can only be set by a secure job using
ON, OFF, MINIMUM, MODERATE,
MAXIMUM the DEFAUL T command, and can be read using the INQUIRE or DINQUIRE commands. For more information, see the "Control Panel Lock" portion of the "PJL Job Security" section in Chapter 5.
DENSITY Returns the toner density setting. 1 to 5 DISKLOCK For volume 0 only, sets the default disk lockout
ON, OFF state. If ON, the disk is read-only and it will not be possible to format the disk, download fonts, delete disk fonts, etc. If OFF, reading and writing are enabled. This variable can only be set by a secure job using the DEFAULT command, and only queried using the DINQUIRE command.
DUPLEX Sets the default mode to enable/disable
ON, OFF printing on both sides of the paper. OFF enables simplex and ON enables duplex printing.
ECONOMODE Default for the ECONOMODE toner-saving
ON, OFF feature used in many of the LaserJet printers.
FINISH Sets the LaserJet 5Si Mopier to staple the
NONE, STAPLE printed output.
FORMLINES Number of lines per page. This variable is tied
5 to 128 to both the PAPER and ORIENTATION variables. If the value of either of those variables is changed, then the FORMLINES variable automatically is updated to maintain the same line spacing.
Range
Environment Commands 6-13
Page 76
General PJL Environment Variables
Variable Description Sample Value
IMAGEADAPT Default for Image Adapt feature. ON enables
ON, OFF, AUTO Lossy compression for use on any images that need to have compression performed. AUTO causes the printer to evaluate other compression alternatives first before Lossy is considered. OFF disables use of Lossy compression.
INTRAY1 Returns the auto-selection lock status for the
MP tray (LaserJet 4/4M, 4/4M Plus, 4V/4MV)
LOCKED,
UNLOCKED or upper tray (LaserJet 4Si/4SiMx).
INTRAY2 Returns the auto-selection lock status for the
standard cassette (LaserJet 4/4M, 4/4M Plus,
LOCKED,
UNLOCKED 4V/4MV) or lower cassette (LaserJet 4Si/ 4SiMx).
INTRAY3 Returns the auto-selection lock status for the
optional cassette (LaserJet 4/4M, 4/4M Plus,
LOCKED,
UNLOCKED 4V/4MV) or envelope feeder (LaserJet 4Si/4SiMx). INTRAY3 is a valid variable only if installed. If it is not installed, the printer returns “?” instead of LOCKED / UNLOCKED, indicating that the variable is unknown.
INTRAY1SIZE Returns the size of the paper currently
installed in the MP tray (LaserJet 4/4M, 4/4M Plus, 4V/4MV), upper tray (LaserJet 4Si/4SiMx), or tray 1 (5/5M/5Si/5SiMx/5Si Mopier/4000 series).
LETTER, LEGAL,
A3, A4, CUSTOM,
A5, LEDGER,
EXECUTIVE,
JISB4, JISB5, B5
COM10, C5, DL,
JPOST, JPOSTD,
MONARCH
INTRAY2SIZE Returns the size of the paper currently
installed in the standard cassette (LaserJet 4/4M, 4/4M Plus, 4V/4MV, 5/5M), lower cassette (LaserJet 4Si/4SiMx), or tray 2 (5Si/5SiMx/5Si Mopier).
LETTER, LEGAL,
A4, A3, LEDGER,
EXECUTIVE,
JISB4, JISB5,
CUSTOM
Range
6-14 Environment Commands
Page 77
General PJL Environment Variables
Variable Description Sample Value
Range
INTRAY3SIZE Returns the size of the paper currently
installed in the optional cassette (LaserJet 4/4M, 4/4M Plus, 4V/4MV, 5/5M), envelope feeder (LaserJet 4Si/4SiMx), or tray 3 (5Si/ 5SiMx/5Si Mopier). INTRAY3SIZE is a valid variable only if currently installed. If it is not installed, the printer returns “?” instead of a
LETTER, LEGAL, A4, A3, LEDGER, EXECUTIVE, JISB4, JISB5, COM10, MONARCH, CUSTOM
paper size, indicating the variable is unknown.
INTRAY4SIZE Returns the size of the paper currently
installed in the envelope feeder. INTRAY4SIZE is a valid variable only if the envelope feeder
COM10, MONARCH, C5,
DL, B5 currently is installed. If it is not installed, the printer returns “?” instead of an envelope size, indicating that the variable is unknown.
INTRAY5SIZE Returns the size of the paper currently
installed in the first optional input tray. INTRAY5SIZE is a valid variable only if the optional tray currently is installed. If it is not installed, the printer returns “?” instead of a
LETTER, LEGAL,
A4, A3, LEDGER,
JISB4, JISB5,
EXECUTIVE,
CUSTOM tray size, indicating the variable is unknown.
INTRAY6SIZE INTRAY7SIZE INTRAY8SIZE
Returns the paper size currently installed in these optional input trays. INTRAYxSIZE is valid only if the optional tray is installed. If
LETTER, LEGAL,
A4, and others
(tray-dependent) not installed, the printer returns “?” instead of a tray size, indicating the variable is unknown.
IOBUFFER Sets the value of the I/O buffering variable. ON, OFF, AUTO IOSIZE Sets up the size, in Kbytes, of the configurable
I/O buffers when IOBUFFER=ON. The size is
10 to maximum
available memory set in increments of 10 Kbytes (up to 100 Kbytes, then in 100 Kbyte increments).
JOBATTR Used to append a string to a list of job
Attribute String” attribute strings associated with the current job. These can be read through the PML object JOB-INFO-JOB_ATTRn.
Environment Commands 6-15
Page 78
General PJL Environment Variables
Variable Description Sample Value
Range
JOBOFFSET Sets the default job offset state. ON, OFF LANG Sets the default display language for the
display panel and unsolicited status feedback display panel messages.
ENGLISH, FRENCH, GERMAN, ITALIAN, SPANISH, SWEDISH, CHINESE, JAPANESE, TURKISH, POLISH, NORWEGIAN, and others (see Appendix A)
LOWTONER Returns configuration for low-toner messages.
If ON or CONTINUE, printer remains online
ON, OFF, STOP,
CONTINUE when the LOW TONER message is displayed; if OFF or STOP, printer goes offline and waits until On Line or Continue key is pressed.
MANUALFEED Manual feed mode. ON, OFF MARGINS Sets the margins for the plot. The SMALLER
and EXTENDED values are used only with roll-feed plotters to reduce the amount of
NORMAL,
SMALLER,
EXTENDED waste media between plots.
MEDIASOURCE Sets the default location of the input media for
the current PJL job.
MEDIATYPE Sets the default media type for the current
PJL job.
TRAY1, TRAY2,
TRAY3
PAPER, SPECIAL,
TRANSPARENCY,
GLOSSY
MIRROR Horizontal reflection of plots. ON, OFF MPTRAY Returns the configuration value of the multi-
purpose tray.
CASSETTE,
MANUAL, FIRST
6-16 Environment Commands
Page 79
General PJL Environment Variables
Variable Description Sample Value
Range
ORIENTATION Page orientation. PORTRAIT,
LANDSCAPE
OUTBIN Sets the default output bin. (For HP LaserJet
4Si, 4SiMx, 4000 series, 5Si, 5SiMx, 5Si Mopier printers, the UPPER output bin is a face-down, correct-order bin. The LOWER output bin is a face-up reverse-order bin.)
OUTLINEPOINT­SIZE
Sets the point size used by PCL-XL to switch from printing characters as bitmaps to
UPPER, LOWER, OPTIONALOUT– PUTBIN1, . . . OPTIONALOUT– PUTBIN62
0 to 999
printing them as outlines.
PAGEPROTECT Page protection configuration. The page
protection feature reserves a block of printer memory to prevent printer overrun errors
OFF, LETTER, LEGAL, A4,
AUTO, ON (error 21) when formatting very dense or complex images, especially HP-GL/2 images. The variable can be set to any legal value at any time, regardless of the current amount of free memory or the currently set resolution. When a job is sent, if there is not enough memory to print correctly with the current resolution and page protection configuration, the system temporarily overrides the resolution and/or page protect values to run the job. In these cases, the job may be printed at 300 dpi without page protection. When the page protection status is changed, memory is reconfigured and all downloaded fonts, PCL macros, and PostScript dictionaries are lost (however, no I/O data is lost). Refer to “Commands that Affect Printer Memory” in Appendix A.
PALETTESOURCE Specifies how color settings are derived, either
from the device’s control-panel settings or
DEVICE,
SOFTWARE through the software application.
Environment Commands 6-17
Page 80
General PJL Environment Variables
Variable Description Sample Value
Range
PAPER Physical paper (and envelope) sizes. Letter,
Legal, Ledger , A5, A4, A3, Executive, JISB4, and JISB5 are paper sizes; Com10, C5, DL, Monarch, and B5 are envelope sizes; JPOST and JPOSTD are Japanese postcard sizes; CUSTOM is for feeding different sizes, but it varies with the printer: the LaserJet 4P/4MP printers interpret CUSTOM as odd sizes, such as 3 x 5 cards and labels; the LaserJet 4V/4MV printers interpret CUSTOM as 11.7" x 17.7" paper.
PAPERLENGTH Sets the length of the paper in decipoints
LETTER, LEGAL, A5, A4, EXECUTIVE, LEDGER, A3, COM10, C5, DL, MONARCH, B5, CUSTOM, JISB4, JISB5, JPOST, JPOSTD and others (see Appendix A)
0 to 432000
(1/720th of an inch).
PAPERWIDTH Sets the width of the paper in decipoints
0 to 432000
(1/720th of an inch).
PARALLEL Sets the speed of the parallel port. This will
FAST, SLOW
not take effect until the next power cycle.
PASSWORD Default password for PJL security. 0 to 65535
6-18 Environment Commands
Page 81
General PJL Environment Variables
Variable Description Sample Value
PERSONALITY Personality for implicit switching (implicit
switching refers to switching to the default personality without explicitly doing so with the @PJL ENTER command). Note that the value
AUTO, PCL,
INSTALLED,
POSTSCRIPT,
ESCP string (PCL, POSTSCRIPT, and so on) for each installed personality is defined by the personality itself. If the AUTO option is selected, and a job is sent without an ENTER LANGUAGE command, the printer looks for context clues to determine which personality takes effect (except in the case of ESC/P, which cannot be selected using context switching). When the personality is changed, memory is reconfigured and all downloaded fonts, PCL macros, and PostScript dictionaries are lost (however, no I/O data is lost). Refer to “Commands that Affect Printer Memory” in Appendix A.
For the LaserJet 4PJ, this variable is assigned on a per-port basis (see “Port-Specific Variables”).
Range
For the DeskJet 1200C, setting this variable to INSTALLED causes the printer to select the default personality from those available. It selects from the available optional personalities before resorting to those available on a standard printer. Reading back the variable identifies the selected variable.
POWERSAVE Enables or disables power-saving feature. ON, OFF POWERSAVETIME Sets the time (in minutes) the printer will
15, 30, 60, 120, 180 remain idle before it enters powersave mode if powersave is on.
Environment Commands 6-19
Page 82
General PJL Environment Variables
Variable Description Sample Value
Range
PRINTAREA INKEDAREA sets the DesignJet to shift the
plot to the top/left and advance the page cut in
FULLSIZE, INKEDAREA
order to save media.
PRINTQUALITY Sets the default print quality for the current
PJL job.
DRAFT,
NORMAL, HIGH QTY Sets the number of collated copies of a job. 1 to 999 RENDERMODE Sets the render mode for the personality. COLOR,
GRAYSCALE REPRINT Determines whether pages are reprinted after
AUTO, OFF, ON
a paper jam. When AUTO is selected and the amount of RAM installed is below a printer­specific threshold, pages are not reprinted after a jam. If the amount of RAM installed is more than this threshold, the pages are reprinted. The ON setting causes the printer to reprint the job after a paper jam. The OFF setting disables reprinting.
RESOLUTION Print resolution in dots per inch. When a job is
300, 600
sent, if there is not enough memory to run with the current resolution and page protection configuration, the system temporarily overrides the resolution and/or page-protect values to run the job. When the resolution is changed, memory is reconfigured and all downloaded fonts, PCL macros, and PostScript dictionaries are lost (however, no I/O data is lost). Refer to “Commands that
Affect Printer Memory” in Appendix A. RESOURCESAVE Sets the value of the resource-saving variable. ON, OFF, AUTO RESOURCE-
SAVESIZE
(This variable is set as a personality-specific
variable using LPARM : personality.) Sets the
size of the resource saving area for the
specified personality if RESOURCESAVE=ON.
0 to maximum available memory (in 100 Kbyte increments)
6-20 Environment Commands
Page 83
General PJL Environment Variables
Variable Description Sample Value
RET Configuration of the Resolution Enhancement
hardware. Resolution Enhancement technology (REt) improves the print quality of
LIGHT, MEDIUM, DARK, ON, OFF,
AUTO characters and graphics by smoothing the edges of lines. Most users do not need to adjust this feature since the default setting works well for almost every type of job.
TIMEOUT Duration of I/O timeouts in seconds. If the
5 to 300 printer waits longer than the timeout value without receiving any data, it ends the print job and begins accepting data from other I/O ports, if any. In most cases, do not adjust this feature unless the printer times out during normal operation, in which case you can try extending the timeout duration. (See the “Timeouts” description in Appendix A.)
WIDEA4 Changes the margins/printable area of A4
NO, YES paper so that 80 10-pitch characters may be printed on a line.
Range
Environment Commands 6-21
Page 84
Port-Specific
Variables
(LaserJet 4PJ Only)
Variables Description Sample Value Range
The following variable is I/O port-specific in the HP LaserJet 4PJ printer, and can be set and requested using PJL. This variable must be set using the IPARM : port option. For the HP LaserJet 4PJ, the valid values for port are SERIAL and PARALLEL.
Port-Specific Variables
PERSONALITY Personality for implicit switching (implicit
switching refers to switching to the default personality without explicitly doing so with the @PJL ENTER command). Note that the value string (PCL, ESCP, and so on) for each installed personality is defined by the personality itself. When the personality is changed, memory is reconfigured and all downloaded fonts and PCL macros are lost (however, no I/O data is lost). Refer to “Commands that Affect Printer Memory” in Appendix A.
PCL, ESCP
6-22 Environment Commands
Page 85
PCL-Specific
Variables
The following variables are PCL-specific and can be set and requested using PJL. These variables must be set using the LPARM : PCL option. A sample value range is shown in this table. See Appendix A for the actual value range for each PJL printer, or use the INFO VARIABLES command to request these values from the printer.
Note These variables are listed in alphabetical order, not the
order they are used. The recommended order for setting FONTNUMBER, FONTSOURCE, and SYMSET is SYMSET first, then FONTSOURCE, then FONTNUMBER.
PCL-Specific Variables
Variables Description Sample Value Range
FONTNUMBER Font number. The valid range for this variable
depends on the currently set font source. If the font source contains a default-marked font, the values start at 0; otherwise, the values start at
1. The upper limit depends on the number of installed fonts in the font source. For example, if there are 50 fonts in the font source and there is a default-marked font, the FONT­NUMBER values range from 0 to 49. In the same situation without a default-marked font, the values range from 1 to 50.
(continued on the following page)
0, 1, 2, . . . n
Environment Commands 6-23
Page 86
PCL-Specific Variables
Variables Description Sample Value Range
FONTNUMBER
(continued)
If the value of the FONTSOURCE changes, then the FONTNUMBER variable automatically is changed to the lowest numbered font in the new font source (0 if the new font source contains a default-marked font; 1 if it does not). If the SYMSET variable changes, the FONTSOURCE and FONTNUMBER default to the highest priority default-marked font (lowest numbered font). When the printer searches for the highest priority default-marked font, cartridges have the highest priority, then SIMMs, then internal default-marked fonts (downloaded soft fonts have the highest priority, but there cannot be a default-marked soft font). NOTE: the recommended order for setting FONT­NUMBER, FONTSOURCE, and SYMSET is SYMSET first, then FONTSOURCE, then FONTNUMBER.
Also, if the currently set font source is S while the currently set font number is the highest­numbered soft font, and a soft font is deleted, the FONTSOURCE variable is changed to the next highest priority font source containing a default-marked font. The FONTNUMBER variable is tied to both the FONTSOURCE and SYMSET variables.
0, 1, 2, . . . n
6-24 Environment Commands
Page 87
PCL-Specific Variables
Variables Description Sample Value Range
FONTSOURCE The valid values for FONTSOURCE are:
I (Internal Fonts) C, C1, C2 (Cartridge Fonts) S (Permanent Soft Fonts) M1, M2, M3, M4 (Fonts stored in one of the printer’s ROM SIMM slots)
The valid values for this variable depend on the currently installed font base. If a font source is specified which does not contain any fonts, then the value is ignored, causing a PJL 27001 error (if verbose unsolicited device status is enabled).
The following events automatically change the value of the FONTSOURCE variable to the next highest priority font source containing a default-marked font: if the currently set font source is C, C1, or C2, and the cartridge is removed from the printer; if the currently set font source is S and all soft fonts are deleted; if the currently set font source is S, while the currently set font number is the highest­numbered soft font, and any soft font is deleted.
I, M1, M2, M3, M4, C, C1, C2, S
(the number of cartridge and SIMM slots varies by printer)
NOTE: the recommended order for setting FONTNUMBER, FONTSOURCE, and SYMSET is SYMSET first, then FONT­SOURCE, then FONTNUMBER.
PITCH Pitch of the default font in units of characters
per inch (the default font must be a fixed-pitch scalable font). The pitch value can be specified to two decimal places.
0.44, 0.45, . . . 99.99
Environment Commands 6-25
Page 88
PCL-Specific Variables
Variables Description Sample Value Range
PTSIZE Height of the default font in units of points (the
default font must be a proportional scalable font). The point size is significant to a quarter of a point.
SYMSET Symbol set. (If the currently selected SYMSET
is WIN3.1J, then the default PCL text parsing method is set to Shift-JIS compatible parsing [WIN3.1J is only available in the HP LaserJet 4PJ, the HP LaserJet 4LJ Pro, and the HP LaserJet 4V/4MV when ESC/P is installed].)
On the HP LaserJet 4LC printer, if the SYMSET is GB2312 then the default PCL text parsing method is set to GB-compatible parsing. [GB2312 is only available in the HP LaserJet 4LC printer.]
4.00, 4.25, . . . 999.75
ROMAN8, ISOL1, ISOL2, ISOL5, PC8, PC8DN, PC850, PC852, PC8TK, WINL1, WINL2, WINL5, DESKTOP, PSTEXT, VNINTL, VNUS, MSPUBL, MATH8, PSMATH, VNMATH, PIFONT, LEGAL, ISO4, ISO6, ISO11, ISO15, ISO17, ISO21, ISO60, ISO69, WIN30, WIN31J, GB2312
6-26 Environment Commands
Page 89
PostScript-Specific
Variables
Variable Description Sample Value Range
The following table lists the currently defined PostScript-specific variables. These variables can be set using the LPARM : POSTSCRIPT option.
ADOBEMBT Normally, when PostScript formats a page in
memory for printing, it formats a full page (full frame). This is the normal operation for PostScript (Adobe MBT set to OFF). In order for the printer to format full frame it must have sufficient memory to store the full page. If there is not sufficient memory the printer will perform some compression on the page to get it to fit in memory. Printed images on these pages may result in the loss of some detail from the original. This formatting method requires considerable memory. With ADOBEMBT ON (enabled), the printer formats a PostScript page in strips. This method does not require as much memory and will not result in loss of detail in images, however it is a little slower and can require up to 20% more formatting time. With ADOBEMBT set to AUTO, the printer will select either full frame, depending on the selected page size and the amount of memory available, or ADOBE MBT. For example, if letter is the page size and the printer has 7 Mb of memory available, the printer will print full frame (disable MBT); if less than 7 Mb is available, the printer will enable MBT and process the page in strips.
OFF, ON, AUTO
JAMRECOVERY Enab l e s o r d i s a bl e s t h e p r in t i n g o f ja mmed
pages following a paper jam. The OFF setting boosts printer performance, but lost pages are not automatically printed after clearing the jam.
PRTPSERRS This variable enables or disables the printing
of a PostScript error page.
OFF, ON
OFF, ON
Environment Commands 6-27
Page 90
ESC/P-Specific
Variables
Note If ESC/P is installed in HP LaserJet 4V and 4MV printers
The following table lists the currently defined ESC/P-specific variables which are valid only for HP LaserJet 4PJ and 4LJPro printers, and optionally for HP LaserJet 4V and 4MV printers. These variables can be set using the LPARM : ESCP option. Note that HP LaserJet 4PJ, 4V, and 4MV factory defaults for these variables are in parentheses.
and a menu reset or cold reset is performed, the printer defaults to FONTNUMBER = 0, FONTSOURCE = I, SYMSET = ROMAN8 and PERSONALITY = AUTO. To re-establish ESC/P as the default personality, set ESC/P as the default personality using PJL or the control panel (in Japan, users can send the ESCPDEF.PJL file).
To print Japanese via PCL using the MS Mincho or MS Gothic typefaces, set the SYMSET to WIN31J, FONTSOURCE to the SIMM slot containing the MS Mincho or MS Gothic font (usually M4), and set FONTNUMBER to 1 for MS Mincho or 2 for MS Gothic. Also set the personality to AUTO or PCL. (Alternatively, in Japan, users can configure the printer for PCL using the PCLDEF.PJL file.)
6-28 Environment Commands
Page 91
Variable Description Sample Value
Range
CARRIAGE­RETURN
Controls how ESC/P interprets the carriage return (CR) control character. The valid values for CARRIAGE-
(CR), CRLF
RETURN are: CR–CR maps to carriage return; CRLF–CR maps to carriage return and linefeed.
CHARACTER­SET
Default character set used for 1-byte printing. Valid values for CHARACTERSET are: KANA–Use katakana
(KANA), EG
character set; EG–Use extended graphics character set.
TOPMARGIN Valid values for TOPMARGIN are: TM19MM–sets top
margin to 19 mm; TM6MM–sets top margin to 6 mm.
ANKCONDENSE Enables or disables whether alphanumeric/kana (ANK)
(TM19MM), TM6MM
ON, (OFF)
characters are printed in condensed mode by default.
FONT Default font used when printing in Kanji mode. (MSMINCHO)
MSGOTHIC
Environment Commands 6-29
Page 92
Setting the Printer to a Desired State
At the beginning of each print job, printer features which affect the printed output must be set to a desired state to print the job as expected. This can be accomplished in two ways:
If the printer has a control panel, the user sets the control panel to values that are appropriate for all users sharing the printer.
For features that must be set on a job-by-job basis, use printer language commands. If a feature cannot be set with a printer language, use PJL.
Applications that generate print data, such as word processors, spreadsheets, and graphics programs, should ensure that the printer is set to a desired state as follows (see Chapter 10 for a description of the various application types):
1. Send the UEL command (<ESC>%-12345X) to start PJL and to default the print environment to the User Default Environment settings.
2. Use the SET command to modify any currently defined envi­ronment variables that cannot be set using the desired printer language. For example, use PJL to set variables such as RET or P AGE PROTECTION that cannot be set with a printer language; then use PCL or another printer language to set the remaining environment variables, such as orientation and number of copies.
Note Do not set features that you do not enable users to set from
6-30 Environment Commands
your application. Any feature set by the application should enable the user to control that featurethis strategy prevents the user from being “locked out” of a particular feature.
3. Enter the desired printer language and use printer lan­guage commands to set all other environment variables to the desired settings.
4. If using a SET command to modify an environment vari­able, use a RESET command to return to its default state.
Page 93
Example: Setting the
Printer to a Desired
State
The following example demonstrates setting HP LaserJet 4 and 4M printers to a known state. For the specific printer you are configuring, consider which environment features you can modify. The modifiable environment features for HP LaserJet 4 and 4M printers are listed below (see Appendix A for a list of environment variables supported by each PJL printer):
COPIES FORMLINES PAPER MANUALFEED ORIENTATION RET PAGEPROTECT PERSONALITY * RESOLUTION TIMEOUT * FONTSOURCE PTSIZE FONTNUMBER SYMSET PITCH PRTPSERRS
* PERSONALITY and TIMEOUT do not affect the printed output and gener­ally should not be used.
Of these HP LaserJet 4 and 4M features, only RET, P AGEPROTECT, and RESOLUTION affect the printed output and cannot be set using the printer language (in this case, PCL). These features are set using PJL, as the following lines show:
<ESC>%-12345X@PJL <CR><LF> @PJL SET RET = MEDIUM <CR><LF> @PJL SET PAGEPROTECT = OFF <CR><LF> @PJL SET RESOLUTION = 300 <CR><LF> @PJL ENTER LANGUAGE = PCL <CR><LF> <ESC>E . . Use PCL to set copies, paper, orientation, line spacing, manual feed, and font selection— values not set using PJL <ESC>E ~<ESC>%-12345X@PJL <CR><LF> @PJL RESET <CR><LF> <ESC>%-12345X
Environment Commands 6-31
Page 94
DEFAULT Command
The DEFAULT command sets the User Default Environment value for the specified environment variable. This value is stored in non-volatile RAM (if the printer has NVRAM) and is activated following a PJL reset condition. The DEFAUL T command does not affect the current print environment, but takes effect when a PJL reset condition occurs. Use this command to change the default value for any environment setting.
For printers that support the P ASSWORD variable, the DEF AULT command will not take effect unless used within a secure job (a job with the correct password in the JOB command).
Note In situations where the printer is shared by several users,
such as networks, restrict the use of the DEFAULT command using PJL security mechanisms. This recommendation allows a standard print environment to be used and avoids having default features changed by different print jobs. Instead, if a printer feature must be changed from the default for a particular print job, use the SET command. In this way, jobs can be successfully printed in any order, since they are not affected by settings from previous jobs.
6-32 Environment Commands
When the DEFAUL T command is used to change the PAGE-PROTECT, RESOLUTION, RESOURCESAVE, RESOURCESAVESIZE, IOBUFFER, or IOSIZEstatus, the printer memory is reconfigured. Reconfiguring printer memory erases all downloaded fonts, PCL macros, and PostScript dictionaries, however no I/O data is lost. Refer to “Commands that Affect Printer Memory” in Appendix A.
Page 95
Syntax: @PJL DEFAULT [LPARM :
IPARM :
LPARM : personality — This optional parameter is used to set personality-specific environment variables. PCL is a valid personality. Other personalities, such as PostScript, can be added as hardware options. Use the INFO CONFIG command to request the range of values for all personalities installed in a particular printer.
LPARM : personality — This option must be used when setting personality-specific variables.
IPARM : port — This optional parameter is used to set port-specific variables. The HP LaserJet 4PJ is the only printer which supports port-specific variables.
IPARM : port — This option must be used when setting port-specific variables. Valid values for port for the HP LaserJet 4PJ printer are SERIAL and PARALLEL.
variable = value — This parameter sets one of the environment variables to the specified value. For example, the @PJL DEFAULT RESOLUTION = 600 command sets the default resolution to 600 dots per inch. See Appendix A for a list of variables and values for each printer. If you need a more detailed description of a particular variable, see the “Environment Variables” section earlier in this chapter.
port] variable
personality
= v
alue
[<CR>]<LF>
|
Note The supported variables and range of values for each
variable may not be the same in all HP LaserJet printer models. See Appendix A for a list of the variables and range of values for each PJL printer. You can also obtain valid variables and the range of values for each variable by sending the INFO VARIABLES command to request this information directly from the printer.
Environment Commands 6-33
Page 96
Parameters:
Parameter Variable Names
personality PCL ESCP
POSTSCRIPT (Other personalities may
also be supported)
port PARALLEL Supported on
SERIAL
variable Valid variables for each printer are listed in
Appendix A.
LaserJet 4PJ only
Comments: The DEFAULT command enables you to specify default
values for either general variables, which are used by all personalities, or personality-specific variables. All personality-specific variables, such as the default PCL symbol set or the PostScript-specific variable PRTPSERRS, must be set using this option. Variables that are not personality-specific cannot be set using the LPARM : personality option.
All port-specific variables must be set using the IPARM:
port option. Variables that are not port-specific cannot be
set using the IPARM : port option. Default values set with this command affect the printer
control panel value and the feature setting stored in non-volatile RAM (in those printers that have a control panel and NVRAM). However, these values do not affect the print environment until a PJL reset condition occurs (see “PJL Reset Conditions” for a list of printer events that constitute a PJL reset). Consequently, if you want the default values to take effect immediately, send a RESET command after sending the DEFAUL T command(s).
6-34 Environment Commands
A separate DEFAULT command must be sent for each environment variable you specify. The command may be used to set any environment variable except the read-only variables. See the “Environment Variables” section of this chapter for a description of each environment variable.
Page 97
Example: Modifying
User Default Settings
This example sets page protection to LETTER for all personalities, and selects the PC8 symbol set for all PCL jobs. A RESET command follows the DEFAULT commands so that the PJL Current Environment defaults to the new settings.
<ESC>%-12345X@PJL <CR><LF> @PJL COMMENT User Defaults <CR><LF> @PJL DEFAULT PAGEPROTECT = LETTER <CR><LF> @PJL DEFAULT LPARM : PCL SYMSET = PC8 <CR><LF> @PJL RESET <CR><LF> <ESC>%-12345X
Related Commands: RESET, SET, JOB, EOJ, UEL
Environment Commands 6-35
Page 98
INITIALIZE Command
The INITIALIZE command resets the PJL Current Environment and the User Default Environment variables to their Factory Default values. This command does not affect the I/O configuration values, some of the configuration values, and the unsolicited status settings. Use the INITIALIZE command to set the printer environment values to their factory default state, such as when you move the printer to a new installation site. (This command is not intended for frequent use, since it resets most environments and control panel settings.)
For printers that support the P ASSWORD variable, the INITIALIZE command will not take effect unless it is used within a secure job (if a password is in use, a secure job is one that contains the correct password in the JOB command).
Note In situations where the printer is shared by several users,
such as networks, restrict the INITIALIZE command. This recommendation allows a standard print environment to be used and avoids having default features changed by different print jobs. In this way, jobs may be successfully printed in any order since they are not affected by settings from previous jobs.
Syntax: @PJL INITIALIZE [<CR>]<LF>
Parameters: The INITIALIZE command has no parameters.
Comments: The INITIALIZE command resets the following
Note Because personalities can be dynamically added to some
6-36 Environment Commands
environment variables to their Factory Default values.
HP LaserJet printers, these printers support more personality-specific variables than those listed here. In any case, the INITIALIZE command causes the PJL Current and User Default environment values for all personalities to default to their factory default state.
Page 99
Variable Names
BINDING ORIENTATION COPIES OUTBIN CPLOCK PAGEPROTECT DISKLOCK PAPER DUPLEX PASSWORD ECONOMODE PERSONALITY FINISH QTY FORMLINES REPRINT IMAGEADAPT RESOLUTION JOBOFFSET RET MANUALFEED TIMEOUT
PCL-Specific Variables
FONTNUMBER PTSIZE FONTSOURCE SYMSET PITCH
PostScript-Specific Variables
JAMRECOVERY PRTPSERRS
ESC/P-Specific Variables
ANKCONDENSE FONT CARRIAGERETURN TOPMARGIN CHARACTERSET
Note The environment variables may vary with different HP
LaserJet printer models. See Appendix A for a list of valid variables, or send the INFO VARIABLES command to request this information directly from the printer.
Environment Commands 6-37
Page 100
Example: Using the
This example initializes the printer:
INITIALIZE Command
<ESC>%-12345X@PJL <CR><LF> @PJL COMMENT Initialize settings to <CR><LF> @PJL COMMENT factory defaults <CR><LF> @PJL INITIALIZE <CR><LF> <ESC>%-12345X
Related Commands: DEFAULT, RESET, SET
6-38 Environment Commands
Loading...