Friday, April 25, 2008 12:01 PM
I wanted to make it easy to deploy so I don't use images. Luckily, 1D barcodes are easy to make with just colored table cells, so I just generate a one row table with a column for each bar. I set the width of the column to be the width of the bar and then color it either black or white.
To use it, just add Barcode.js to your site, include it in a script tag, then use the AtalasoftBarcode39 object to draw the barcode (there is a file called BarcodeTest.html in the zip file to show an example). Here's some sample code
var bc = new AtalasoftBarcode39(s);
bc.getBarcode(50, 2, 8);
The three arguments to getBarcode are the height and the widths of the narrow bars, and the width of the wide bars.