Skip to content

angusgibbs/barcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Barcode.js by Angus Gibbs

Generates barcode 39 labels in browser.

Usage

Once you have barcode.js included on your page, call barcode.create to generate your barcode:

var code = barcode.create('HELLO WORLD');

Valid letters are 0-9, A-Z, +, -, $, %, ., /, and (space). barcode.create throws an error if an invalid letter is entered.

Note: lowercase letters, which are not allowed by the barcode 39, will be converted to uppercase.

Once you have your barcode, you can either add it to the DOM with #appendTo or get its source data with #src():

code.appendTo(document.querySelector('body'));

// or

code.appendTo($('body')); // Works with jQuery!

// or

var src = code.src();

Support

Barcode.js should with with all browsers that support canvas, so:

  • IE 9+ (further support can be added using explorercanvas)
  • Firefox 3.6+
  • Chrome
  • Safari 3.1+
  • Opera 9.0+
  • iOS Safari 3.2+
  • Android 2.1+

About

Generate barcode 39 labels in browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published