Business::US::USPS::IMB - Perl Binding for usps4cb
use Business::US::USPS::IMB; my ($bar_string, $result_code) = encode_IMB($track_code, $route_code);
This module is an interface to usps4cb, providing access to USPS Intelligent Mail Barcode encoder functionality provided by this library. You will need the correct fonts in order to create actual barcodes. This module only provides a correctly formatted encoding string, not the actual barcode.
For more information on this library see the following documentation:
Encoder software libraries, examples and fonts made available by the USPS.
encode_IMB
This function takes a tracking number and routing number as parameters and returns a barcode string and result code. If something went wrong, the barcode string will be undef.
Possible result codes and their explaintions are
SUCCESS 0
SELFTEST_FAILED 1
BAR_STRING_IS_NULL 2
BYTE_CONVERSION_FAILED 3
RETRIEVE_TABLE_FAILED 4
CODEWORD_CONVERSION_FAILED 5
CHARACTER_RANGE_ERROR 6
TRACK_STRING_IS_NULL 7
ROUTE_STRING_IS_NULL 8
TRACK_STRING_BAD_LENGTH 9
TRACK_STRING_HAS_INVALID_DATA 10
TRACK_STRING_HAS_INVALID_DIGIT2 11
ROUTE_STRING_BAD_LENGTH 12
ROUTE_STRING_HAS_INVALID_DATA 13
For further information on result code descriptions please refer to the USPS documentation on the usps4cb library available at the link to Encoder Software and Fonts above.
Learn about the data content to be encoded, encoding rules to produce bars from data fields, physical dimensions of printed barcodes, and physical limitations on printing. The specification document (USPS-B-3200) also covers how the encoding and decoding algorithms work and provides sample programming code.
Get information about the tools and applications available to you from the Postal Service™ as well as from vendors for creating and validating the Intelligent Mail barcode.
Chris Nighswonger, <cnighswonger@gmail.com>
Copyright (C) 2012 by Chris Nighswonger
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
The usps4cb library is licensed in accordance with the terms outlined in the accompanying USPS_LICENSE.txt file.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Service™'. Assuming UTF-8
To install Business::US::USPS::IMB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::US::USPS::IMB
CPAN shell
perl -MCPAN -e shell install Business::US::USPS::IMB
For more information on module installation, please visit the detailed CPAN module installation guide.