Script Library: 1238 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
View scriptLicenseDownload documentation as: HTML or editable
Download scriptHistoryOther scripts by: swhite

Documentation for: usps4cb.r

Intelligent Mail Barcode encoder


This module provides a function for using a "dll" file from the USPS 
that will create the necessary encoding so that you may print one 
of the new Intelligent Mail barcodes.  The new barcode is not like 
the old. When you use this module, you do NOT get a barcode.  What 
you get is a string of letters which are then printed with a barcode 
font.  THAT is what produces the new barcode.  You can not manually 
translate a zip code into the encoding string.  There is a lot of 
calculation behind the scenes.


Make sure that the file usps4cb.dll is in the same directory as your 
program. Then load this module:

do %usps4cb.r

When you load the module as shown above, the result will be a function 
that you may call to encode a zip code for printing.  As part of 
the loading process, the module also will use the library to do a 
test encoding so that if anything goes wrong, you could look at the 
test results to make sure that things are working correctly.

To encode a zip code, you have to know not only your zip code, but 
your tracking number.  This is a number you get from the USPS.

This module does not help find the values you need to encode for 
anything. All it does is perform the encoding.  WHAT you encode is 
up to you.

When you have those numbers available, set their values in the words:


Then call the function with:


The resulting encoding will be in IMB-BARSTRING.  The encoding will 
be 65 characters of the letters ADTF.  This encoding is what you 
print, using the proper barcode font.