I recently had a project that used a 3 of 9 coded barcode.

The original app used a flash object, but we had a few problems resizing the barcode.

I took the original font that I had used and created 40 GIF files that can be used to create barcodes. With a little experimenting I got it to work well enough to put into production.

You may have to tweak barcode sizes and the paddind of the images, but here is the basic code available for your download.

You must inclide the bc39.js file as a script. If you change the path to the barcode images you will have to alter the bc39.js file. You might also teak the padding which is in the file.

The 3 of 9 character set is limited character set of upper case letters, numbers and a few extra characters. This code does not work with spaces, but could be altered to deal with space correctly.

The character set allowed is: $%*+-./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

The * is the beginning and ending character so it cannot be used for anything else. For a 3 of 9 barcode to work it must start and end with *.

There are two functions, showBar() and getBar(). Both receive the string to print and the width and height of each barcode character.

The showBar function used document.write to add the barcode inlin on your web page. Here is an exampleof showBar().


You can also use the getBar() function to put the code into a container.

You can download a zip of the javascript and the images bc39js.zip