Chapter 5. Code39gen utility

To assist our customers to verify that the barcode string calculation is implemented correctly, we provide a command-line utility called code39gen. This utility is written in perl and requires perl interprer. You can download perl from ActiveState or perl.org. If you want to know the details, load this file in a text editor such as emacs, or Windows notepad.

For more information, enter code39.pl -h . The image below is taken from a Mac OS/X system:

Figure 5.1. Code39gen utility

Code39gen utility

There are two methods to invoke the program. The first one is universal:

perl code39gen.pl [options] 

On Unix platforms (including Mac OS/X), you can treat it as a shell script after you add 'exec' attribute to the file:

chmod +x code39gen.pl 
code39gen.pl -h

Code39gen accepts three command options, -h, -k and -e. Their usages are listed below:

Code39gen command line options

-h

Display the program usage

-k

Add modulo 43 check digit to the barcode

-e

Use code 39 extended to encode the data. This option must be turned on to create barcode string for extended code 39.

To encode data containing space, you must enclose the whole data with double quotes. For example, to encode extended code39 for data Apache 12345, the command line is:

code39gen -e "Apache 12345"