HN user

manuels__

33 karma
Posts3
Comments12
View on HN

Tobias Schneider's barcode scanner [1] is a great example for a simple bar code scanner (<100 lines) However, it turned out to be not very accurate in a lot of cases. That's why I ported ExactImage's [2] bardecode [3] to javascript using emscripten [4].

I hope you like it.

[1] https://gist.github.com/tobeytailor/421369 [2] http://www.exactcode.com/site/open_source/exactimage/bardeco... [3] http://manpages.ubuntu.com/manpages/lucid/man1/bardecode.1.h... [4] http://emscripten.org/

Thanks ivan_ah! I really didn't expect so much positive response!

Yes, the main work is done in the webworker (~250kb) + the tex format file latex.fmt (~700kb)

Sad to hear that. I don't use Safari, but maybe it cannot compete with the JS engines of Firefox and Chrome's version of the Webkit engine.

This script reqiures a lot of computation in JS and communication between the website and the webworker (~300kb). Maybe Safari is unable to cope with this in a decent amount of time.

Thanks for your hints! I added a 'Open PDF' button to circumvent popup blockers.

Yes, I used emscripten to port it to Javascript. It was not that hard. Emscripten had three bugs I had to fix (the hardest was to find that the %g format was not supported by emscripten's sscanf).

But it was compiled almost like for x86: first convert the pdftex 'web' souce code to c using web2c, then compile it to LLVM bytecode and the LLVM bytecode to JS.