Please note that i no longer have access to HP printers, so cannot support this software. You might find it useful, but if it doesn't work with the latest laserjets, i can't help you, sorry.
OVL - Create macro overlays for Database programsUsage
History
The Algorithm
Changes & Bugs
Compiling
Special Thanks
Also see Kevin Smith's version, a complete rewrite with he says: "more sophiscated escape sequence parsing" (haven't tried it yet, but it looks good...).
Source Code - ovl.zip version 2.2 (Nov 1999) (27Kb) (A prebuilt DOS .exe is included). This new version allows you to specify the macro ID number. Just run the program for help. Sorry I don't have time to update the documentation at present.
This program was orginally written for a Corporate Database report generating system.
To avoid using expensive pre-printed laser forms, the graphical form is printed on plain paper. When printing hundreds of invoices (for example) it is becomes very slow if the graphics are printed repeatedly. Laserjet macro overlays allow you to send the graphical part of a printed form once to the printer and have it repeat on every page automatically.
A form is created in any graphics program capable of printing to a
Laserjet such as Corel or FormFlow and converted by OVL into an
Overlay.
This overlay is sent to the printer and stored in printer memory as a
macro. Each subsequent page printed will now have the overlay in the
background.
The overlay will stop printing when a reset command "<esc>E", disable
automatic overlay "<esc>&f5X", or one of the delete macro commands are
issued.
This program supports HP Laserjet printers 3, 4 and 5 series and can
produce landscape and portrait overlays.
You can then send the overlay to the printer.
Normally, unless the default printer font is OK, you will want to specify
orientation, lines per inch and characters per inch, e.g.:
<esc>&l0O<esc>&l6D<esc>(s10H
specifies portrait, 6 lines per inch and 10 characters per inch (<esc> is
1b hex). Send these codes to the printer after the overlay.
Then send each page of report data followed by a form feed (0C hex). the overlay will appear on the background of each sheet.
For an example print file, printer font file and alignment test sheet, see the example directory.
The following header is added to the start of each overlay:
"<esc>E<cr>" + "<esc>&l0O<cr>" + "<esc>&f1y0x0S<cr>" +
"<esc>*r0F" + "<esc>&l4d1E"
(the <esc>&l0O may be <esc>&l1O for landscape)
And the footer is added to the end:
"<esc>&f1s1x10x4X<cr>"
SPECIAL PJL/PCL - Some PJL/PCL commands must be deleted under certain conditions:
| Form Feed (0xc) | Delete if in last 16 bytes of file. |
| @ sign | Indicates a PJL command, delete up until next escape character if "@" is in first 16 bytes of file. |
| <esc>E (0x1b+"E") | Printer reset, delete. |
| <esc>*r0F | Raster graphics presentation mode, delete. |
| <esc>%-12345X | Start of PJL language, delete. |
| <esc>&l5X | Where 5 is 0..999 and X is A,H,G,O,P,S or X, delete. |
| <esc>&lxxxxxX | Multiple command, where x is any character or digit, and X is any uppercase character. If in first 0x100 bytes of file, delete (max 20 chars). |
| <esc>)s | If followed by "W" within 6 bytes, we have a soft font. Allow this, but print a warning. |
The program has been thoroughly tested, but if you do find any bugs, please let me know.