Showing results for 
Search instead for 
Did you mean: 

HP - ESC commands

Go to solution
Occasional Visitor

HP - ESC commands

Is HP printers (laserjet & deskjet0 have a set or ESC commands like what Epson printers have? My purpose on this is to compress a printout using the software commands under DOS application.
Bill Hassell
Honored Contributor

Re: HP - ESC commands

HP printers (since the early 80's) use a language called PCL (Printer Control Language) which is ASCII with escape sequences to control special functions. All these escape sequences are documented in the printer technical reference manuals, or in HP's web pages:

To compress a fixed font, use:


where Ec is the single character ESC. For other spacing:

10 cpi Ec&k0S
12 cpi Ec&k4S

Reset printer to default: EcE

There are several *dozen* models of HP printers and about 6 flavors of PCL. The above sequences work on all of them. When you begin manipulating the other features, some sequences may not apply or may have different values.

Bill Hassell, sysadmin