Introduction
PCL is the printer language that Hewlett-Packard created for its printers in the early
1980s and made famous with the LaserJet. A PCL file is the stream of commands a printer
driver sends to the printer, saved to disk instead: usually from “print to file”, with
the extension .pcl or the generic .prn. Most office laser
printers still understand it, alongside
PostScript.
PCL 5, from 1990, added scalable fonts and the HP-GL/2 vector language. PCL 6, also called PCL XL, is a different, binary language that works like a stack machine; many drivers produce it instead of PCL 5.
Structure
PCL 5 commands are escape sequences: the byte 1B (Escape) followed by
printable characters. Esc E resets the printer, and longer commands give a
group, a value and a final letter, such as Esc&l1O for landscape.
Text between commands is printed as it is. Raster images are sent row by row with
their own commands.
A print job is often wrapped in Printer Job Language (PJL): it starts with the
Universal Exit Language sequence Esc%-12345X, followed by lines starting
@PJL, such as @PJL ENTER LANGUAGE=PCL, which tell the printer
which language follows.
<Esc>%-12345X@PJL JOB
@PJL ENTER LANGUAGE=PCL
<Esc>E
Hello, page one
<Esc>E
<Esc>%-12345X@PJL EOJ
<Esc>%-12345X
Links
Software
- GhostPCL, part of Ghostscript, which renders PCL 5 and PCL XL to PDF or images (Windows, macOS, Linux)