JsBarcode is a simple way to create different types of 1d barcodes.
The plugin uses Html5Canvas to generate draw the barcodes
- CODE128 (B)
- EAN (13)
- UPC-A
####A Html5Canvas barcode generator is included to draw the barcodes.
$(object).JsBarcode(string,options);
####Where:
- string is the sring to be encoded to the barcode
- options is additional options put i an object (look below)
####The default options:
{
width: 2,
height: 100,
quite: 10,
format: "CODE128"
}
####First we need an image
<img id="barcode">
$("#barcode").JsBarcode("Hi!");
$("#barcode").JsBarcode("Javascript is fun!",{width:1,height:25});
$("#barcode").JsBarcode("9780199532179",{format:"EAN"});
setInterval(function(){
var date = new Date();
$("#barcode").JsBarcode(date.getHours()+":"+date.getMinutes()+":"+date.getSeconds());
},1000);
Use the closure compiler with this input
// ==ClosureCompiler==
// @output_file_name JsBarcode.all.min.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/CODE128.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/EAN_UPC.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/JsBarcode.js
// ==/ClosureCompiler==