ZLPR:
A Bare-Bones Command-Line Text File Printing Utility (for HP-Compatible
Printers)
by Leor Zolman
Open Source Freeware in C++ (well, sort of)
Click here
to download the ZIP archive [updated May 3,
2004]
Description:
Written eons ago by Leor Zolman in BDS C, updated for C++ January,
2002 (but only uses some "Better C" features of C++).
The zlp.cpp program and ZLPR.BAT batch file comprise a very simple
command-line-driven printing utility for ASCII text files using
HP-compatible printers.
Have you ever had an ASCII file you wanted printed, with just a
little bit of processing such as a header on each page, rudimentary
font size selection, number of copies, page ejection when complete,
etc., without having to bring it up in Word or some other overbloated
app? This utility provides just enough capabilities to be a no-frills
solution to the problem.
The C++ program, zlp.cpp, accepts options and filenames on the
command line, and writes its output to the standard output. zlp
is *not* meant to be used directly; rather, the batch file ZLPR.BAT
is meant to drive it. ZLPR.BAT writes the output of zlp to a temporary
file, copies that file to the Windows LPT1: device (by default;
it also works with network printers by specifying their UNC names),
and then deletes the temporary file(s). To support multiple simultaneous
instances (allowing several files to be queued up), ZLPR.BAT uses
a rotating temp-file scheme.
Only a single printer is supported, selectable via hard-coding
the batch file.
While ZLPR isn't rocket science, it has aged fairly gracefully
over the past 22 years (which is more than can be said for its author...)
Some useful things to know:
--> By default, output is generated at 66 lines/page
--> The -fl (dash
eff ell) option uses "lineprinter" font, allowing longer
lines and generating 88 lines/page
--> zlpr -? or
-h shows you all
the zlp options.
Installation:
- If necessary, edit ZLPR.BAT to set the PRINTER variable to
the name of the printer you wish the output printed on (LPT1:
as distributed)
- Copy zlp.exe and ZLPR.BAT into some directory in your PATH.
Feedback (bugs, suggestions, whatever) is always appreciated --
contact leor@bdsoft.com.
Home |
Courses |
Tools |
Resources
Clients |
Successes |
Contact |
Site Map |
Links |
About Us
All text and images on this website are Copyright © 2001-2003 BD Software. All rights reserved.
|