[comp.mail.misc] postnet bar codes

DLV@CUNYVMS1.BITNET (01/31/91)

Yeah, I guess there's no reason why comp.mail.misc shouldn't be used to discuss
USPS. :)

OK, my experience shows that putting facing identification marks and postnet
codes on envelopes doesn't seem to do anything on local mail, but may speed up
delivery by a day for non-local mail. The downside is, some folks see those bar
codes, assume that the letter is junk mail, and throw it away. :) A couple of
years ago I wrote LaTeX macros for making envelopes with postnet codes and
posted them to TeXHAX. If you use them, you may have to change some things
for your printer, device driver, and pre-printed stationery. Here they are:

---

env.tex (sample file)
% This is used to print one or more envelopes on the laser printer.

%\begin{envelope}
%Prof. Blah\\
%Department of Mathematics\\
%City, State Zip
%\ZipBar{Zip-Zip}
%\end{envelope}

\documentstyle[12pt,env]{article}
\nofiles
\begin{document}

\sf

\from{Dimitri Vulis}

\begin{envelope}
Dimitri Vulis\\
Department of Mathematics\\
33 West 42 Street\\
New York, NY 10036\\
\ZipBar{10036-8099}
\end{envelope}
\end{document}

---
env.sty:

\textwidth9.5in
\textheight6.675in
\pagestyle{empty}
\special{ps: landscape}

\def\@from{}
\def\from#1{\def\@from{#1}}

\newbox\EnvLeft
\newbox\EnvRight
\newbox\ZipBarL
\newbox\ZipBarS                               %1/64"         1/32"
\setbox\ZipBarL\hbox{\vrule \@height.125in \@width.015625in\hskip.03125in}
\setbox\ZipBarS\hbox{\vrule \@height.05in  \@width.015625in\hskip.03125in}
%each black bar is about 4.6 dots wide on a 300dpi printer
\newcount\ZipBarm
\newcount\ZipBarn
\chardef\ten=10

%Almost like using \ifcase... except `-' is ignored.
\def\ZipBar@@@#1#2{\expandafter\def\csname ZipBar@@#1\endcsname%
{#2\advance\ZipBarn#1\relax}}

\ZipBar@@@0{\copy\ZipBarL\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS\copy\ZipBarS}
\ZipBar@@@1{\copy\ZipBarS\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL\copy\ZipBarL}
\ZipBar@@@2{\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS\copy\ZipBarL}
\ZipBar@@@3{\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL\copy\ZipBarL\copy\ZipBarS}
\ZipBar@@@4{\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL}
\ZipBar@@@5{\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS}
\ZipBar@@@6{\copy\ZipBarS\copy\ZipBarL\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS}
\ZipBar@@@7{\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL}
\ZipBar@@@8{\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS}
\ZipBar@@@9{\copy\ZipBarL\copy\ZipBarS\copy\ZipBarL\copy\ZipBarS\copy\ZipBarS}

\def\ZipBar@@#1{\csname ZipBar@@#1\endcsname}

\def\ZipBar@#1{%
 \ifx#1\null%
  \let\next\relax%
 \else%
  \ZipBar@@{#1}%
  \let\next\ZipBar@%
 \fi%
 \next}

\def\ZipBar#1{%
 \setbox\EnvRight\hbox{%
 \copy\ZipBarL% start with a long bar
 \ZipBarn\z@%
 \ZipBar@#1\null%
 \ZipBarm\ZipBarn%
 \divide\ZipBarm\ten%
 \multiply\ZipBarm\ten%
 \advance\ZipBarm-\ZipBarn%
 \ifnum\ZipBarm<0%
  \advance\ZipBarm\ten%
 \fi%
 \ZipBar@@{\the\ZipBarm}% last digit, so that the sum is divisible by ten
 \copy\ZipBarL% end with a long bar
 }}

\def\corner{\setbox\EnvLeft\hbox}

\def\envelope{
\newpage
\setbox\EnvRight\hbox{\vrule \@height.125in \@width \z@}
\setbox\EnvLeft\null
\raggedright
\vspace*{2.985in}% Fill in the blank on our stationary---change as needed
\parindent.32in% left aligns with the pre-printed return address
\@from
\vfill
\parindent3.5in}
%A fancier way would be to put the street address in a box and to center it
\def\endenvelope{\par
\parindent.32in% left aligns with the pre-printed return address
\vbox{%
 \vspace{.5in}%
 \hbox to \hsize{%
  \vbox {\vss\box\EnvLeft}
  \hfill%
  \box\EnvRight%
  \hskip1.5in %from zip bar to right edge
  }%
  \vskip.375in %from zip bar to bottom
}}

---
Dimitri Vulis
CUNY GC Math

jf@ap.co.umist.ac.uk (John Forrest) (02/01/91)

In article <9101310318.AA21806@lilac.berkeley.edu> DLV@CUNYVMS1.BITNET writes:
>
>Yeah, I guess there's no reason why comp.mail.misc shouldn't be used to discuss
>USPS. :)
>

I've nothing against it either, but to save the rest of the
world what about adding a few

Distribution: us

around the place? -)

John Forrest, Dept of Computation, UMIST