home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume32
/
envelope
/
part01
/
README
< prev
Wrap
Text File
|
1992-09-20
|
3KB
|
63 lines
Envelope Addresser tool, Perl script.
Given an address, either from stdin or a file argument,
addresses a commercial envelope, including generating postal
bar codes, on your HP Laserjet II or III printer or compatible.
You may want to adapt this to print your return address, as shown
in the commented-out example.
You may have to adjust the X-Y coordinates if your envelopes are
non-standard (or you don't like where I put things!)
In order for the barcode stuff to function properly, the last address
line must end in a zip code, either 5 digits or (zip+4 format)
5 digits, a dash, and 4 digits. Well, ok, I don't check specifically
for that format, but am looking for the end of the last line, minus
white space, to consist of 5 to 10 dashes and/or digits. It is up
to you to provide the garbage-in in the right format for me to
generate the right garbage-out.
The barcode portion of this perl script was inspired by a recent posting
to alt.sources:
From: todd@toolz.uucp (Todd Merriman)
Newsgroups: alt.sources
Subject: Generate postal barcodes on HPLJ
Message-ID: <1991Aug13.220925.28106@toolz.uucp>
Date: 13 Aug 91 22:09:25 GMT
Organization: Software Toolz, Inc.
Todd wrote a C program to generate the barcodes only, and mentioned
how useful it would be to any U.S.P.S. mail program:
barcode.c
This is a program to produce postal barcodes on an HPLJ. It was
printed in the Winter '90 issue of the C Gazette (a fine publication).
For a complete technical description, see that issue of the magazine.
This code could probable be easily adapted to almost any mailing
list manager, as it accepts the zip code digits in ASCII and outputs
the required HPLJ graphics commands to product a properly formatted
postal bar code.
Dave Buck Caveats:
I haven't read the article mentioned by Todd, and only attempted to verify
the implementation by visual comparison to the barcodes I've actually seen
added by the U.S.P.S. themselves on three commercial envelopes I received
in yesterday's mail. So you KNOW what the warranty's worth on this one.
{aeras,amdahl,ames,daver,netcomsv,sun,zygot}!dlb!dave
D. L. Buck and Associates, Inc.; San Jose, California 95119; (408)972-2825
Andy Rabagliati ported this to PostScript. I corrected a bug on the
check digit calculation. I use labels, as my printer seals envelopes
put through it !! You may have to twiddle the PostScript stuff if you
want envelopes. I hope I have made this easy.
I stuck in the #ifdef conditional stuff, and you will notice that the
script invocation includes a -P option - this is so Perl runs it all
through the PreProcessor to get the HP or PostScript version.
Enjoy, Andy.