Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PostOffice Intelligent Barcodes
Message
 
To
08/03/2017 09:22:21
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01648854
Message ID:
01648876
Views:
147
>Hello--
>
>Has anyone worked with the USPS Intelligent Barcodes with VFP? I am now needing to add this support and looking at options and ways to incorporate this functionality. Any advice or sample code would be greatly appreciated.
>
>Greg


I never implemented it, however, I did some research into it. Here are my notes, hopefully they are helpful:

There are two ttf fonts:
USPSIMBCompact.ttf
USPSIMBStandard.ttf

And there is a C dll encoder:
usps4cb.dll
libusps4cb.a

You use the encoder to come up with a string that looks like this:
FFTTDAADTTADTFDDFDDTFAFATDTDDFDAFDADDADDAFAAAFTTFTFDTFAAADADDDFDF

which is then used with the font to print the barcode.

The encoder can be called like this:

DECLARE USPS4CB In c:\myfolder\usps4cb.dll string TrackPtr, string RoutePtr, string BarPtr

Local lcTrack, lcRoute, lcBar
lcTrack = "53379777234994544928"+chr(0)

** this is zipcode
** zip = 5
** or zip+4 = 5+4
** or with delivery point = 5+4+2
lcRoute = "51135759461"+chr(0)

lcBar = space(65)+chr(0)

RetCode = USPS4CB(lcTrack,lcRoute,@lcBar)
? "Return Code:",RetCode
? "Bar:", lcBar


The Tracking Code string (TrackString) contains 20 digits in the following form:

AASSSCCCCCCNNNNNNNNN
where:

AA is the 2-digit barcode Identifier. The second digit must be 0, 1, 2, 3, or 4.

SSS is the 3-digit Service Type Identifier code.

CCCCCC is the 6-digit Mailer Identifier.

NNNNNNNNN is the 9-digit Serial Number.

Please note that the Mailer ID can be a 6-digit or 9-digit number based upon mailer’s volume. Since the Mailer ID and Serial Number are interdependent, the Serial Number is a 6-digit or 9-digit number depending on the length of the Mailer ID. If the Mailer ID is 6 digits, the Serial Number must be 9 digits. If the Mailer ID is 9 digits, there are 6 digits available for the Serial Number.


the Service type Identifiers can be found here:
http://ribbs.usps.gov/intelligentmail_mailpieces/documents/tech_guides/stid.pdf

It appears that the serial # just needs to be unique. Start from 1 and increment.
Brandon Harker
Sebae Data Solutions
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform