You can add barcodes in the markup, by adding the barcode
class to an HTML element, containing the barcode text.
Use barcode2
for double size. To specify which subtype to use, specify a second class: code128a
,
code128b
or code128c
.
View source for the markup. No images, no server-side stuff. Just HTML, Javascript and CSS.
The barcodes have been tested with onlinebarcodereader.com and zxing.org.
This blog made some improvements, I hopefuly incorporate in my code (thanks to Zachary Zebrowski for bringing this to my attention).
2012-04-24
: Does print now (kudos to Michael Specht)2012-02-20
: Code is now MIT Licensed.2011-06-20
: Fixed an issue with the iPad (iOS in general) and 10 digit barcodes on this page.2011-06-18
: Added subtype override for use with base2, after question by Clarence Stephenson. Previous version here.2011-04-23
: Created a version that's not dependend on base2, and updated the CSS to have a bigger size barcode. Original version here.2011-02-13
: Now also works in Firefox (removed single file support, now you need to include the CSS. See this bug), and updated to base2 revision r309. Original version here.2010-01-13
: Fixed bugs (type C with odd length is now correct, prepend a 0). Old version here + added a test form.2010-01-05
: Fixed two bugs (checksum and type-A conversion). Old version here.2012-04-23
: I made my own Barcode 128 clock this library (and Qr code clock with Google's API)!2010-01-05
: Jack Zielke made a Barcode Clock with this library!