#lang scribble/doc @; THIS FILE IS GENERATED @(require scribble/manual) @(require (for-label (planet neil/postnet:1:=1))) @(require (for-label racket)) @title[#:version "0.4"]{@bold{postnet}: USPS POSTNET Barcode Encoding in Racket} @author{Neil Van Dyke} License: @seclink["Legal" #:underline? #f]{LGPL 3} @(hspace 1) Web: @link["http://www.neilvandyke.org/racket-postnet/" #:underline? #f]{http://www.neilvandyke.org/racket-postnet/} @defmodule[(planet neil/postnet:1:=1)] @section{Introduction} This @bold{postnet} Racket library can be used to generate the United States Postal Service POSTNET barcode binary pattern, as described in Chapter 4 of USPS Publication 25, ``Designing Letter and Reply Mail,'' dated 2003-06. This library supports ZIP, ZIP+4, and DBPC codes. The generated binary representation is a Racket list of boolean values. Separate code must be written to render this representation to a particular printing devices. @section{Encoding} There are several procedures for encoding POSTNET from various input representations. It is suspected that most applications will encode from a string representation, using @tt{string->postnet}. @defproc[ (digit-list->postnet (digits any/c)) any/c]{ Yields a POSTNET encoding of a list of digit numbers. For example: @SCHEMEBLOCK[ (digit-list->postnet '(1 2 3 4 5)) ==> (#t #f #f #f #t #t #f #f #t #f #t #f #f #t #t #f #f #t #f #f #t #f #t #f #t #f #f #t #f #t #f #t) ] } @defproc[ (char-list->postnet (chars any/c)) any/c]{ Yields a POSTNET encoding of a list of characters. For example: @SCHEMEBLOCK[ (char-list->postnet '(#\1 #\2 #\3 #\4 #\5)) ==> (#t #f #f #f #t #t #f #f #t #f #t #f #f #t #t #f #f #t #f #f #t #f #t #f #t #f #f #t #f #t #f #t) ] } @defproc[ (string->postnet (str any/c)) any/c]{ Yields a POSTNET encoding of a string. For example: @SCHEMEBLOCK[ (string->postnet "12345-6789 01") ==> (#t #f #f #f #t #t #f #f #t #f #t #f #f #t #t #f #f #t #f #f #t #f #t #f #t #f #f #t #t #f #f #t #f #f #f #t #t #f #f #t #f #t #f #t #f #f #t #t #f #f #f #f #f #f #t #t #f #t #f #f #t #t) ] } @section{Debugging} Although this package does not render POSTNET for OCR use, for debugging purposes, the @tt{postnet->debug-string} procedure can be used to approximate the barcode visually, using ASCII characters. @defproc[ (postnet->debug-string (postnet any/c)) any/c]{ Yields a string visual approximation of a POSTNET encoding. For example: @SCHEMEBLOCK[ (postnet->debug-string (string->postnet "12345")) ==> "|...||..|.|..||..|..|.|.|..|.|.|" ] } @section{History} @itemize[ @item{Version 0.4 --- 2011-08-22 -- PLaneT @tt{(1 1)} Changed references to Scheme to Racket. Changed URL. } @item{Version 0.3 --- 2009-03-03 -- PLaneT @tt{(1 0)} Licensed changed to LGPL 3. Converted to author's new Scheme administration system. Previous version was erroneously in planet as package @tt{postnet-planet.plt}. } @item{Version 0.2 --- 2005-07-12 Added Testeez tests. Minor documentation changes. } @item{Version 0.1 --- 2004-04-14 Wrote as a diversion over dinner. } ] @section[#:tag "Legal"]{Legal} Copyright (c) 2004--2011 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License (LGPL 3), or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author. @italic{@smaller{Standard Documentation Format Note: The API signatures in this documentation are likely incorrect in some regards, such as indicating type @tt{any/c} for things that are not, and not indicating when arguments are optional. This is due to a transitioning from the Texinfo documentation format to Scribble, which the author intends to finish someday.}}