Tell a printer she's a plotter

A handy trick to expand the possibillities of your laserprinter

Every HP Laserjet compatible printer (like my trusty old Brother HL-4Ve) is able to understand HPGL plotter commands. You only need to switch the machine into HPGL mode and back again.
If you forget to switch it back to PCL mode, you're in deep shit. Only a hard reset will get it out.

Entering HPGL mode

We leave PCL mode and enter HPGL mode by sending the following control string to the printer:

ESC%1B

From now on, the printer has forgotten that it is a laserjet. It only knows it's origin was a box which read HP 7475A. It will only listen to plotter commands, plus one single command that is ignored by other plotters.
It will not listen to formfeeds. Nor to printer reset strings. It will only Pen Up and Plot as all her sisters do.

Leaving HPGL mode

There is just one non-HPGL command that a converted printer will execute

ESC%1A

From this moment on, the printer knows not better as to be (and never have been anything else than) a true PCL style laserprinter. It will carry out any command as it did before entering HPGL mode.

Some HPGL commands.

In the other file (Look for 'HPGL codes' in the navigator) is a full list. Here are some to wet your appetite.

Command Does
df DeFault
pw 0.2 Pen Width 0.2 mm
sp 1 Select Pen 1
pu Pen Up
pa x,y; Plot Absolute
pd Pen Down
pr Plot Relative
dt# Define terminator (for text entries)
Make sure the "dt#" is not followed by a "df" command! The default is ASCII-003!
si 0.12, 0.25 SIze 0.12 cm wide, 0.25 cm high
lb Some text# LaBel (prints "Some text").
The # is the terminator. Forget it and you're in for a surprise!
di 1,0 Change the text printing direction to horizontal (1,0) or vertical (0,1) or diagonal (1,1).
lt L,3 LineType used for drawing lines. "L" is the line type, "3" is the period of a pattern.
lt draws solid lines again.
pg eject a page (formfeed)

An application: the sheets program.

I have published a fully functional program which uses these commands to output graphs that are completed by production departments. Please study the file "frsheets.html", (click link in 'Navigator' on the right) which describes the software, written in Modula-2.

I hope that this file has given some more background. Use the navigator to get back or forth.

Source created in 1994 and webpage