[comp.text.desktop] PostNet Barcodes

leete@mac.cc.macalstr.edu (04/24/91)

Hi, I'm looking for info on programs to print PostNet barcodes on envelopes in
MS/PC-DOS.  PostNet is the special barcode accepted by the US Postal Service
and is commonly seen on the botton of bill envelopes.  You can get a special
postage rate for using barcodes with the USPO.  The USPO will only give you
addresses of service bureaus that will convert addresses for a hefty fee.  If
you know of programs to produce PostNet barcodes please lend me a hand.
Thanks
		-Jennie Leete

v105mahs@ubvmsd.cc.buffalo.edu (Peter P Donohue) (04/24/91)

In article <1991Apr24.011358.322@mac.cc.macalstr.edu>, leete@mac.cc.macalstr.edu writes...
>Hi, I'm looking for info on programs to print PostNet barcodes on envelopes in
>MS/PC-DOS.  PostNet is the special barcode accepted by the US Postal Service
>and is commonly seen on the botton of bill envelopes.  You can get a special
>postage rate for using barcodes with the USPO.  The USPO will only give you
>addresses of service bureaus that will convert addresses for a hefty fee.  If
>you know of programs to produce PostNet barcodes please lend me a hand.
>Thanks
>		-Jennie Leete

   I don't know of any programs that do this offhand, but it shouldn't be 
too hard to write something that did it.  All the code is is a binary 
translation of the zip code that you are sending to.  Each tall bar means
that the bit is on, each short that it is off.  The bits are grouped in
fours, with a tall bar on each side of the group, so that they can produce 
between 0 and 9.
     Number	PostNet code
	0	|....|
	1	|...||       	 Consider each '|' to be a tall bar and
	2	|..|.|		each '.' to be a short.
	3	|..|||
	4	|.|..|
	5	|.|.||
	6	|.||.|
	7	|.||||
	8	||...|
	9	||..||
   This information is all available in various US Mail publications.
Try the ones that they will send you if you tell them you are interested
in third class mail.

							Pete
-----------------------------------------------------------------------
Peter P. Donohue - University at Buffalo, Graduate School of Management
bitnet:   V105MAHS@UBVMS                  .  "Education is a journey
internet: V105MAHS@UBVMS.CC.BUFFALO.EDU   .    not a destination..."

dcd@tc.fluke.COM (David Dyck) (04/28/91)

In article <1991Apr24.011358.322@mac.cc.macalstr.edu> leete@mac.cc.macalstr.edu writes:
>... looking for info on programs to print PostNet barcodes on envelopes in
>MS/PC-DOS.  PostNet is the special barcode accepted by the US Postal Service
>and is commonly seen on the botton of bill envelopes. ...

Back in May-90  Woody Baker posted the following info to comp.lang.postscript
	(I emailed the postscript program to leete@mac.cc.macalstr.edu)

>From: woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal)
Newsgroups: comp.lang.postscript
Subject: Re:US POSTAL BARCODE
Summary: USPS BARCODE
Message-ID: <1253@chinacat.Unicom.COM>
Date: 21 May 90 04:28:33 GMT

During the trade show, that I did the airplane for, I ran across the
United States Postoffice booth.  They were giving out free, nifty
holographic stamed envelopes.  These are FANTASTIC!  They have been on
sale since Dec.  The envelope cost is .05 and the postage cost is
.25 for a total cost of .30.  Go to your nearest post office and buy
one!  Earlier, I had spent about an hour "cracking" the USPS bar code
printed at the bottom of prepaid mailer cards.  A call to the Postoffice
as to how to compute the check digit did not yeild any usefull info.  The
lady at the show booth however, sent me publication 25, A Guide to Business
Mail Preparation, along with a nifty transparent template.  I got it, and
immediatly created the following program (something that I have wanted
for a long time.)  Bulk mailers get cheaper rates for presorted by zipcode,
and presumable the bar code will give you a better rate as well. (I have not
verified this.)  So, here is the barcode printer, as well as an address
positioner that meets USPS policy.

Enjoy
Cheers
Woody

[  postscript program deleted ]

v105mahs@ubvmsb.cc.buffalo.edu (Peter P Donohue) (04/28/91)

In article <1991Apr27.190905.23979@tc.fluke.COM>, dcd@tc.fluke.COM (David Dyck) writes...
>In article <1991Apr24.011358.322@mac.cc.macalstr.edu> leete@mac.cc.macalstr.edu writes:
>>... looking for info on programs to print PostNet barcodes on envelopes in
>>MS/PC-DOS.  PostNet is the special barcode accepted by the US Postal Service
>>and is commonly seen on the botton of bill envelopes. ...
> 
>Back in May-90  Woody Baker posted the following info to comp.lang.postscript
>	(I emailed the postscript program to leete@mac.cc.macalstr.edu)
> 
stuff deleted...
> 
>[  postscript program deleted ]

   Could you post the postscript code?  If not here, perhaps to comp.binaries 
or comp.lng.postscript?  Thanks.

							Pete

-----------------------------------------------------------------------
Peter P. Donohue - University at Buffalo, Graduate School of Management
bitnet:   V105MAHS@UBVMS                  .  "Education is a journey
internet: V105MAHS@UBVMS.CC.BUFFALO.EDU   .    not a destination..."

jwhiting@cdp.UUCP (04/30/91)

The ElsweWare Barcode Kit, availablefrom ElseWare Corp. in Seattle, has 
both Type 1 fonts and EPS files for POSTNET, Code 39, Interleaved 2 of 5 
and UPC bar codes for the Macintosh.  206 547-9623.

dcd@tc.fluke.COM (David Dyck) (04/30/91)

I have had several requests to post the postscript program.
This is what I received in comp.lang.postscript last May.

>From: woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal)
Subject: Re:US POSTAL BARCODE
Message-ID: <1253@chinacat.Unicom.COM>
Date: 21 May 90 04:28:33 GMT
Organization: a guest of Unicom Systems Development, Austin

During the trade show, that I did the airplane for, I ran across the
United States Postoffice booth.  They were giving out free, nifty
holographic stamed envelopes.  These are FANTASTIC!  They have been on
sale since Dec.  The envelope cost is .05 and the postage cost is
.25 for a total cost of .30.  Go to your nearest post office and buy
one!  Earlier, I had spent about an hour "cracking" the USPS bar code
printed at the bottom of prepaid mailer cards.  A call to the Postoffice
as to how to compute the check digit did not yeild any usefull info.  The
lady at the show booth however, sent me publication 25, A Guide to Business
Mail Preparation, along with a nifty transparent template.  I got it, and
immediatly created the following program (something that I have wanted
for a long time.)  Bulk mailers get cheaper rates for presorted by zipcode,
and presumable the bar code will give you a better rate as well. (I have not
verified this.)  So, here is the barcode printer, as well as an address
positioner that meets USPS policy.

Enjoy
Cheers
Woody


%
%
% (C) Copyright 1990 by Woody Baker
% Rt.1 Box I
% Manor, Tx. 78653
%
% this code may be used for personal use,  as long as this header
% remains intact but may not be used
% as part of a commercial package.  All commercial rights reserved.
%
%
% code to print usps barcode.
% checkdigit computation is the sum of the digits, rounded up to
% the next even multiple of 10.
%
% You MUST print this on the envelope within certain very specific areas.
% The x and y coordinate MUST have the following relationship with the
% RIGHT LOWER CORNER of the envelope.
% x can be no further from the right edge than 4" and no closer than
% 3 1/4.  The y coordinate MUST be 1/4 inch up from the bottom of the
% envelope, +/- 1/16 th inch.  The x coordinates' wide lea-way is
% to accomodate shifting of inserts containing POSTNET codes which appear
% through windows in the envelope.  For printed barcodes on envelopes
% the post office prefers 3 7/8 to 4 inches.
% request Publication 25 (A Guide to Business Mail Preparation) from
% your local Post Office.  Be sure to ask for the template that accompanies
% the book.
%
/inches {72 mul} def
/barwidth .020 inches def	% MUST NOT CHANGE
/long  .125 inches def		% MUST NOT CHANGE
/short .050 inches def		% MUST NOT CHANGE
/nextx .0475 inches def		% MUST NOT CHANGE
%
% one of the recommended fonts for OCR lables.  10/14 is one of the
% recommended settings.
%
/Helvetica findfont 10 scalefont setfont
/linehite 14 def
%
/digarray
	[
	{
	lbar lbar sbar sbar sbar 	% digit 0
	}	
	{
	sbar sbar sbar lbar lbar 	% digit 0
	}
	{
	sbar sbar lbar sbar lbar 	% digit 2
	}
	{
	sbar sbar lbar lbar sbar 	% digit 3
	}
	{
	sbar lbar sbar sbar lbar 	% digit 4
	}
	{
	sbar lbar sbar lbar sbar 	% digit 5
	}
	{
	sbar lbar lbar sbar sbar 	% digit 6
	}
	{
	lbar sbar sbar sbar lbar 	% digit 7
	}
	{
	lbar sbar sbar lbar sbar 	% digit 8
	}
	{
	lbar sbar lbar sbar sbar 	% digit 9
	}
	] def

%
% sbar does a short bar, and alters the current point accordingly
%
%
/sbar
	{
	barwidth setlinewidth		% always make sure it is correct width
	currentpoint			% remember where we are
	currentpoint short add lineto	% do the bar
	exch nextx add exch moveto	% advance the current point
	} def
%	
% lbar does a tall bar and alters the current point accordingly
%
/lbar
	{
	barwidth setlinewidth		% always make sure it is correct width
	currentpoint			% remember where we are
	currentpoint long add lineto	% do the bar
	exch nextx add exch moveto	% advance the current point
	} def
%
% routine takes a string of numbers (no hyphens in the first cut)
% an orientation flag (1=Landscape) and an x and y coordinate
%
%
% x y orientation (numberstring)
%
% check digit computation 10 sum 10 mod sub computes the remainder
% from a divide by 10, and then subtracts that from 10 to generate
% a digit, which if added back to sum would round it up to the next even 
% multiple of 10
%

/dobar
{
	/msg exch def	% get all parameters from the stack.
	/orient exch def
	 moveto % relative to origin of mail piece
	/sum 0 def
	
	gsave
	 	orient 1 eq
	 		{
	 		90 rotate 0 -612 translate
	 		} if
		lbar		 % starting marker
		msg		 % process the message.
			{
			48 sub dup		% convert the digit to binary
			sum add /sum exch def	% update the checksum
			/digval exch def	% have the binary digit
			digarray digval get  exec % draw the digit.
			}
		forall
		digarray
		10 sum 10 mod sub		% compute check digit	
		get exec
		lbar				% ending marker
		stroke
	grestore
} def	

%
% routine takes x y array of strings and does an address block
% for an envelope.  Prefered is ALL UPPERCASE
% [(WOODY BAKER) (RR 1 BOX I) (MANOR  TX  78653)]
% NOTE: the City State and Zip MUST be the last line, and in that order.
% it is preferable NOT to use punctuation.  If the last line won't fit, it
% is permitted to put the ZIPCODE on the line under that, all by itself.
% you should provide that decision, when constructing the array of strings.
%
% In addition, since this is HELVETICA, and it is Proportional, it
% is a wise idea to put 2 spaces down rather than 1 for separation.  The
% USPS states that there should be at least 1 full space or 1 em space
% between the characters, and at least 2 points additional 
% leading between the lines, 4 points is better for a 10 pt font.
%
% bottom line of RETURN address no lower that 2 3/4" from bottom edge
% of envelope. Mailto address should fit  within a rectangle that extends
% from 5/8 " from the bottom, to 2 1/4" up from the bottom of the mail piece.

%
/address
	{
	/stringaray exch def
	/ycoord exch def
	/xcoord exch def
	xcoord
	stringaray length		% get number of lines
	linehite mul ycoord add moveto	% adaptively find the top line.
	stringaray
		{
		currentpoint linehite sub exch pop xcoord exch moveto
		show
		} forall
	} def
%
% example code for testing
%
100 120 [(WOODY  BAKER) (RR 1  BOX I) (MANOR  TX  78653-0102)] address
100 100 0 (786530102) dobar
200 200 1 (1234567890) dobar
showpage

ries@venice.SEDD.TRW.COM (Marc Ries) (04/30/91)

Under MSDOS Windows 3.0, there is a shareware program called "winbar"
that does POSTNET barcodes (but currently not the "+4" barcode that
goes in the upper right area).

Under MSDOS, there are at least two that do both POSTNET bar codes.
One is shareware, one is commercial.  Sorry, but I don't have the
names handy.  The shareware one  is on Simtel in the laser printer
directory -- something like "envlj" or ?.