9

I'm looking for an open source image generation script for Aztec (2D) barcodes:

Aztec Barcode

I can't seem to find any available scripts out there.

There is an Active-X control here that can be used only in IE and an image generator URL here, but these are not useful as it should be a pure javascript solution running under webkit-based browsers that can run in disconnected mode for mobile apps.

Anyone have some old code for this hanging around either written in javascript or that can be ported to javascript?

Thanks.

Steven de Salas
  • 20,944
  • 9
  • 74
  • 82

1 Answers1

9

bwip-js runs in any browser that supports <canvas> – IE 9+, FF 2+, Chrome, Safari 3+, Opera 9+, and Android 2.1+. It also runs server-side in Node. (If you wanted downlevel IE support, try using a <canvas> emulation layer.)

Aztec is among the 83 barcode formats it can draw. Here's a demo of it in action.

O. Jones
  • 103,626
  • 17
  • 118
  • 172
josh3736
  • 139,160
  • 33
  • 216
  • 263
  • It seems to work for server side JS (node) but does it work for client side JS? – powtac Mar 08 '12 at 19:05
  • Yes, any browser that supports `` works. See *demo.html* in the download ZIP. – josh3736 Mar 08 '12 at 19:15
  • I see an POST request to the server in FireBug and a hard result to an image on the server... – powtac Mar 08 '12 at 19:19
  • 1
    You clicked [this link](http://www.terryburton.co.uk/barcodewriter/generator/), which is a demo of the [PostScript](http://en.wikipedia.org/wiki/PostScript) [implementation](http://code.google.com/p/postscriptbarcode/) that bwip-js is based on. [Download the bwip-js ZIP](http://code.google.com/p/bwip-js/downloads/list) and look at *demo.html* in that file. – josh3736 Mar 08 '12 at 19:23
  • I tried it already, there are errors everywhere (FF 10 on WIN 7). – powtac Mar 08 '12 at 19:34
  • Works fine for me on Win 7 with Chrome 18, FF 10, and IE 9. (Perhaps an issue with running the file from disk (`file:///...`) instead of over http?) – josh3736 Mar 08 '12 at 19:57
  • ...[threw it up as a JSFiddle](http://jsfiddle.net/josh3736/tAaBe/), see if that works for you. – josh3736 Mar 08 '12 at 20:07
  • It works! Great library by the way! Is it yours? I'm currently working on some canvas image merging stuff... – powtac Mar 08 '12 at 20:09
  • Nope. Just a cool (and completely unnoticed) library I found. – josh3736 Mar 08 '12 at 20:20