HP PCL/PJL reference - Printer Job Language Technical Reference Manual

C-4 Programming Examples EN
Example: Using RDYMSG in a Batch File
This example demonstrates how to use a batch file to send PJL
commands to the printer. In this example, the batch file acts as a
spooler, using the RDYMSG command to display the file name while
a print file is being downloaded.
To send PJL commands this way, first create an ASCII file named
UEL, containing only the UEL command (<ESC>%-12345X). In this
file, be sure to substitute ASCII character 27, the escape character,
for <ESC>, and do not add any spaces or characters after the X.
Then create a batch file as shown here, and save it as
PRINTPJL.BAT, in the same directory as the “UEL” file. The batch file
uses the DOS ECHO command to send PJL commands and the DOS
COPY command with the /B option to send the UEL file and
pre-existing PRN file to the printer.
@ECHO OFF
CLS
ECHO Printing the %1 Job!
COPY UEL /B PRN:
ECHO @PJL > PRN:
ECHO @PJL JOB > PRN:
ECHO @PJL JOB DISPLAY = "%1" > PRN:
ECHO @PJL RDYMSG DISPLAY = "%1" > PRN:
ECHO @PJL ENTER LANGUAGE = PCL > PRN:
COPY %1 /B PRN:
COPY UEL /B PRN:
ECHO @PJL COMMENT Restore READY message > PRN:
ECHO @PJL RDYMSG DISPLAY = "" > PRN:
ECHO @PJL EOJ > PRN:
COPY UEL /B PRN:
@ECHO ON
Note For the HP LaserJet 4000 printer, and newer printers, the RDYMSG
DISPLAY method will not replace the front panel display message.
Use the JOB DISPLAY = “display text” method. Use both methods to
ensure compatibility with all printers. See page 8-2.