Pdf417 Read / Decode Javascript

I was instructed to add decoding / reading to the pdf417 (Driving License) for a web application.

Login: Image of driver’s license. (400-600 dpi)

Processing: data detection / analysis pdf417.

Result: analyze the pdf417 data.

Limitations: his web application works through: IE, Chrome, Safari. I can not install anything on the local computer.

So, I have been investigating for several days, and I have not found a good way to do this work. Ideally, all decoding will happen on the client machine using Javascript / JQuery. However, I did not find any scripts / libraries that can do this. The only other options I found were perhaps a Java servlet or php extension; both of which are not perfect, because load times will push me to my time.

Does anyone know of any javascript or jQuery library that can handle this?

Or maybe the best way to enable this functionality that I don't see?

+4
source share
3 answers

. - ( !) 100% , , JavaScript, CAVEAT: Chrome/Firefox, , , Safari (6+) IE (IE10 +). http://caniuse.com/filereader

-, , , , PDF417, .

OK : a) JavaScript ( ) , ( ), ... ) JavaScript ( Java); ... c)... JavaScript / - PDF417, "" , . , Java , Java-, , Chrome, Java , .

, a)

HTML- . :

<input type="file" id="myFileInput">

, b)

, JavaScript ( ) HTML5 FileReader Api (. http://blog.teamtreehouse.com/reading-files-using-the-html5-filereader-api)... :

var reader = new FileReader();
// ... and ...
reader.readAsDataURL(file);

readAsDataURL() base64-encode, , src , var ing = new Image();. .. src data:image/gif;base64,*data*. -. Canvas 2D- appendChild(), DOM, . , , - blog.teamtreehouse.com(http://codepen.io/matt-west/pen/CfilG). , FileReader() (http://www.sitepoint.com/reading-images-data-using-canvas-javascript/), , , 5mins30secs.

, c)

, , , , - UPC: http://badassjs.com/post/654334959/barcode-scanning-in-javascript (demo = http://tobeytailor.s3.amazonaws.com/get_barcode_from_image/index.html). , , new Image() ( , src API FileReader()) Canvas 2d. , , , , PDF417:

http://en.wikipedia.org/wiki/PDF417

http://omniplanar.com/PDF417-2D-Barcode.php

!

+5

, , , - https://github.com/PeculiarVentures/js-zxing-pdf417, PDF417 .

100% - .

, , .

- ( , ..), -.

+2

Emscripten https://github.com/kripken/emscripten provides a ready-made root for compiling C ++ into JavaScript. There is a demo cross compiled by a PDF417 reader at https://www.newtonapples.net/PDF417_demo/USBcam_demo.html that will read PDF417 barcodes in javascript in a browser (Chrome or Firefox) that has a decent USB webcam. However, the code is commercial, not open source.

+2
source

All Articles