PJL

From Hacking Printers
Jump to: navigation, search
Classic prank: PJL displays ‘HACKED’

The Printer Job Language (PJL) was originally introduced by HP but soon became a de facto standard for print job control. ‘PJL resides above other printer languages’ [1] and can be used to change settings like paper tray or size. It must however be pointed out that PJL is not limited to the current print job as some settings can be made permanent. PJL can also be used to change the printer's display or read/write files on the device. There are many dialects as vendors tend to support only a subset of the commands listed in the PJL reference and instead prefer to add proprietary ones. PJL is further used to set the file format of the actual print data to follow. Without such explicit language switching, the printer has to identify the page description language based on magic numbers. Typical PJL commands to set the paper size and the number of copies before switching the interpreter to PostScript mode are shown below:

@PJL SET PAPER=A4
@PJL SET COPIES=10
@PJL ENTER LANGUAGE=POSTSCRIPT

PJL can be used for various attacks such as denial of service, manipulating hardware page counters, gaining access to the printer's memory and file system as well as malicious firmware updates.

Related articles: Printer Control Languages, Denial of service, Accounting bypass, Memory access, File system access



  1. Printer Job Language Technical Reference Manual, HP Inc., 1997, p. 1