Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: any luck with envelopes Summary: Computers aren't just for e-mail, y'know Message-ID: <1453@toaster.SFSU.EDU> Date: 31 Mar 91 10:35:32 GMT References: <1991Mar25.202018.4253@math.ucla.edu> <1444@toaster.SFSU.EDU> <1991Mar30.191057.22404@ecst.csuchico.edu> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Distribution: usa Organization: San Francisco State University Lines: 99 [This thread is Distribution: usa on comp.sys.next; apologies to foreign NEXT-L readers.] In article <1991Mar30.191057.22404@ecst.csuchico.edu> tempest@walleye.uucp (Kenneth K.F. Lui) writes: >What are FIMs and would "normal" people make use of barcodes? "normal" people don't have NeXT laser printers. :-) FIMs are the half-dozen or so 5/8"-high bars in the upper right of things like Business Reply Mail and Penalty Mail. Their specification can be found in USPS Pub. 25 (A Guide to Business Mail Preparation). Your friendly neighborhood [depository] library should have this. >How do businesses use them--to sort out what type of business >reply mail they get? Basically, what all the funny markings do is make it easier for Postal Service automation to process mail. People who use them qualify for lower postal rates, and the more they're used "period," the less vicious our postal rate increases are supposed to be. That's the theory, anyway. (Would your government ever lie to you? :-) ) Actually, a Truly Useful address printer probably has to do more stuff, like presorting and keylines. While individuals don't have much to gain from this, small businesses would. I don't claim to understand it all, I just RTFM like everybody else. It *looks* simple enough. Try running your ZIP code through the following and see if it agrees with the barcodes on your junk mail. moveto where you want the lower left. For bounding box calculation, a ZIP+4 code renders as 52 bars; there are 21 bars per inch, bars are .02" wide and .125" (or .05") tall. Hmm... Something tells me I better double-check those numbers. -=EPS=- ------- % PostScript to draw USPS barcodes % x y moveto (12345-6789) addcheckdigit showbarcode /addcheckdigit { % takes string /checkdigit 0 def dup { % sum digits 1 string dup 0 4 3 roll put % convert ASCII code to character (0123456789) exch search { pop exch pop % if it's a digit cvi checkdigit add /checkdigit exch store % add to sum } { pop } ifelse % else ignore } forall 90 checkdigit sub 10 mod /checkdigit exch store % generate check digit dup length 1 add string dup 3 1 roll copy pop % expand string dup dup length 1 sub checkdigit 1 string cvs putinterval % append check digit } bind def % returns string /longbar { % show a "long" bar currentpoint 0 9 rlineto 1.44 0 rlineto 0 -9 rlineto closepath fill exch 72 21 div add exch moveto } bind def /shortbar { % show a "short" bar currentpoint 0 3.6 rlineto 1.44 0 rlineto 0 -3.6 rlineto closepath fill exch 72 21 div add exch moveto } bind def /showbarcode { % takes string longbar % draw guard bar { 1 string dup 0 4 3 roll put % convert ASCII code to character (0123456789) exch search { pop exch pop % if it's a digit cvi % show bars [ % 7 4 2 1 0 { longbar longbar shortbar shortbar shortbar } % 0 { shortbar shortbar shortbar longbar longbar } % 1 { shortbar shortbar longbar shortbar longbar } % 2 { shortbar shortbar longbar longbar shortbar } % 3 { shortbar longbar shortbar shortbar longbar } % 4 { shortbar longbar shortbar longbar shortbar } % 5 { shortbar longbar longbar shortbar shortbar } % 6 { longbar shortbar shortbar shortbar longbar } % 7 { longbar shortbar shortbar longbar shortbar } % 8 { longbar shortbar longbar shortbar shortbar } % 9 ] exch get exec } { pop } ifelse % else ignore } forall longbar % draw guard bar flush } bind def % returns - -- This is your brain. /This { PostScript (your brain) on } is Any questions?