Updated May 22 2003

PJL with Canon networked printers


PJL or Printer Job Language provides job level printer language switching, job separation, changing of printer settings, and status readback.  PJL acts as a wrapper around the PDL(s) Printer Description Languages like PCL and postscript.  So if we wanted to add PJL commands to a PCL job, the whole PCL job must be inside the PJL. The most common reason you will be using PJL is to set the finishing options for the copiers as PCL has no commands setup for this.  

There are 4 basic types of  PJL commands:
1.  UEL or Universal Exit Language – <ESC>%-12345X
2.  COMMENT – add comments and proprietary commands
3.  SET – change current setting
4.  ENTER – enter a new PDL

The nice thing is that for the most part they are completely human readable, much easier to read than PCL.

1.  UEL or Universal Exit Language – <ESC>%-12345X
All PJL jobs must begin and end with the Universal Exit Language (UEL) command:
<ESC>%-12345X
This command must be followed by @PJL, except at the end of the print job.  This tells the printer to go into PJL mode.  We don't need to use @PJL for the last UEL as we are resetting the printer and are not entering PJL mode.

2.  COMMENT – add comments and proprietary commands
@PJL COMMENT **Rick's PCL tutorial rocks**<CR><LF>
You can put in whatever you want to say here.  Used for adding comments to your code.
Canon also uses this to add proprietary SET commands.  see SET command below.

3.  SET – change current setting
The structure of the PJL SET command for HP supported options is:
@PJL SET function=value<CR><LF>
To set Canon options use the structure
@PJL COMMENT CANPJL SET function=value<CR><LF>
@PJL COMMENT CANPJL SET STAPLE=TWOLEFT<CR><LF>

You can get a list of supported functions and values from the Canon PJL manual for your model.  Contact developers support or technical support for these manuals.

Note:  <CR> and <LF> are ASCII control characters.  Do not type what you see but what they repersent. hex 0D and 0A.
Note:  <CR> is not mandatory but a very good idea.  Both HP and Canon say to use it however the UNIX editors, like vi, usually only insert <LF> and they still work fine.

4.  ENTER – enter a new PDL
@PJL ENTER LANGUAGE=PCL<CR><LF>
@PJL ENTER LANGUAGE=POSTSCRIPT<CR><LF>
When we are finished with are PJL programming and we want to enter the PDL used for the job, we need to use one of these commands.  Our PCL or PS job will begin directly after the <LF>.

Here is a very basic example of a PJL job.

<ESC>%-12345X@PJL<CR><LF>
@PJL SET DUPLEX=ON<CR><LF>
@PJL COMMENT CANPJL SET STAPLE=TWOLEFT<CR><LF>
@PJL ENTER LANGUAGE=PCL<CR><LF>
<ESC>Epage1<FF>page2<FF>page3<FF>page4<ESC>E<CR><LF>
<ESC>%-12345X

Notice there is no @PJL or <CR><LF> at the end of the job.

Both HP and Canon recommend that you send a command for every option and feature the machine is capable of even if you are not using it.  If you are going to write a printer driver or an application this is an excellent idea.  Since we won't know what the control panel settings are we need to overwrite them all.  In many environments, where the user knows what the control panel settings are, it is easier to insert the one or three commands that you need.

To see what a properly formatted job looks like, print to file using the Canon PCL5e driver for the imageRUNNER 600.  open the file in a ASCII or hex editor.  enjoy.

Next is troubleshooting PCL and PJL.

Prev     Beginning     Next