2:0
postnet: USPS POSTNET Barcode EncodingπβΉ
Link to this document with
@other-doc['(lib "postnet/postnet.scrbl")]
Link to this document with
@other-doc['(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["Introduction" #:doc '(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["Introduction" #:doc '(lib "postnet/postnet.scrbl")]
This postnet Racket package 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
package 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.
Link to this section with
@secref["Encoding" #:doc '(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["Encoding" #:doc '(lib "postnet/postnet.scrbl")]
There are several procedures for encoding POSTNET from various input
representations. It is suspected that most applications will encode from a
string representation, using string->postnet.
(digit-list->postnet digits) β (listof boolean?)
|
digits : (listof exact-positive-integer?) |
Yields a POSTNET encoding of a list of digit numbers. For example:
> (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) |
(char-list->postnet chars) β (listof boolean?)
|
chars : (listof char?) |
Yields a POSTNET encoding of a list of characters. For example:
> (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) |
(string->postnet str) β (listof boolean?)
|
str : string? |
Yields a POSTNET encoding of a string. For example:
> (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) |
Link to this section with
@secref["Debugging" #:doc '(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["Debugging" #:doc '(lib "postnet/postnet.scrbl")]
Although this package does not render POSTNET for OCR use, for
debugging purposes, the postnet->debug-string procedure can be used to approximate the barcode visually, using
ASCII characters.
(postnet->debug-string postnet) β string?
|
postnet : (listof boolean?) |
Yields a string visual approximation of a POSTNET encoding. For example:
> (postnet->debug-string (string->postnet "12345")) |
"|...||..|.|..||..|..|.|.|..|.|.|" |
Link to this section with
@secref["History" #:doc '(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["History" #:doc '(lib "postnet/postnet.scrbl")]
Version 2:0 β 2016-02-28
Version 1:1 β 2011-08-22
Version 1:0 β 2009-03-03
Licensed changed to LGPL 3.
Converted to authorβs new Scheme administration system.
Previous version was erroneously in planet as package "postnet-planet.plt".
Version 0.2 β 2005-07-12
Version 0.1 β 2004-04-14
Link to this section with
@secref["Legal" #:doc '(lib "postnet/postnet.scrbl")]
Link to this section with
@secref["Legal" #:doc '(lib "postnet/postnet.scrbl")]
Copyright 2004, 2005, 2009, 2011, 2016 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, 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.