Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Context: I need to scan a data matrix barcode with the camera of my android mobile phone. I access the camera over html5 and got the picture into a canvas element.

Approach: I can't find a javascript library for scanning a picture to decode a 2D data matrix code. Actually i call the ZXing App and copy and go backt etc. So i'm not happy with this laborious solution.

Question: Somebody knows a javascript library for decoding 2D data matrix codes? Or maybe an easy solution by using another app like ZXing / Goggles and get the result of the scan automatically back in JS?!

I'd appreciate your input.
Posted
Comments
Sergey Alexandrovich Kryukov 29-Sep-14 11:41am    
Why Javascript? Any legitimate reason to do so?
Also, there are different barcode standards; not all libraries support them all. Which one is yours?
—SA
tvelop 29-Sep-14 12:00pm    
Cause it's a web application which supports offline functionality, used by android-based mobile devices.
Sergey Alexandrovich Kryukov 29-Sep-14 12:26pm    
It does not answer to this concern... For example, you could have Java application communicating with the Web application, something else...
And what is the barcode standard to be used?
—SA
tvelop 29-Sep-14 12:44pm    
Hm okay, i thought JS is the only option here. I'm curious and happy with any other solutions to fix this! At the end my offline web application should be able to scan this barcode using the camera and save the result in my local storage or indexeddb. How do i achieve this?
What do you mean with "barcode standard"? DataMatrix ECC200?
Sergey Alexandrovich Kryukov 29-Sep-14 13:10pm    
I think the problem is a bit too hard for Javascript, then you cannot find the solution. It's easier to find for Java. You did not explain why "JS is the only option".
—SA

1 solution

Please see my comments to the question, the part where I advise to use Java, C or C++. Then you would be able to find an open-source library.

With C/C++, you can use this open-source library: http://www.libdmtx.org[^].

You can try to find some more: http://bit.ly/1pmrWZ3[^].

Many products are commercial, but try to spot something of open-source.

—SA
 
Share this answer
 
Comments
tvelop 30-Sep-14 3:55am    
Thanks for your advise! I can write a separate application for the scan/decoding part, but i can't rewrite the web application as a Java/C application. Maybe you know a comfortable solution to get back the result from the app to my web app? Maybe by using a service, public method or shareable folder?
Sergey Alexandrovich Kryukov 30-Sep-14 11:05am    
I advised to use C/C++ or Java application only on the client side.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900