Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I implement a Web barcode scanner in React to work in browser (desktop/mobile)?

I would like to have a camera view, which uses device's camera and detects barcodes' data. How can it be done in a React app?

Not for React Native. It has to work both on desktop and mobile using browser.

like image 940
Eric Torosyan Avatar asked Jun 21 '19 11:06

Eric Torosyan


People also ask

How do I scan barcodes into my browser?

1. 3D Touch the Chrome app icon and choose Scan QR Code. 2. Pull down to reveal the Spotlight search box, search for "QR" and select Scan QR Code from Chrome's listing.

Is it possible to make a web app with barcode scanner?

As long as you use a barcode library implemented in JavaScript, you can make your web apps work on both desktop and mobile. I've written an article - How to Build Web Barcode Scanner Using React and Webcam which shows you how to build such an app from scratch using Dynamsoft JavaScript Barcode SDK.

How do I add a tab to a barcode scan?

Physical barcode scanners act as a keyboard, so if you set focus to the text field where you want the code to be placed by default, once you scan the code, it will appear in the text field, the scanner can be configured to add an (Enter) or (Tab) at the end, so that you can handle this to process the scanned value. – Bilal Dec 19 '18 at 19:00

What is barcode reader for the web?

Scan barcodes from your websites using any camera-equipped device. Whether your app is used by your employees or by your customers, you just want it to work – quickly and reliably. That’s why we developed our Barcode Reader for the Web using machine-learning algorithms. You can now benefit from:

How to create a barcode scanner with quaggajs?

1. Create a react application First of all, create a simple react application using the create-react-app. Run the following command to create an app. 2. Install quaggaJS package Run the following command to install quaggaJS to implement a barcode scanner.


1 Answers

As long as you use a barcode library implemented in JavaScript, you can make your web apps work on both desktop and mobile.

I've written an article - How to Build Web Barcode Scanner Using React and Webcam which shows you how to build such an app from scratch using Dynamsoft JavaScript Barcode SDK.

Dynamsoft JavaScript Barcode SDK is commercial software. If you want to use open-source SDK for free, you can use ZXing as the substitution.

Here is the source code:

https://github.com/yushulx/zxing-cpp-emscripten

like image 181
yushulx Avatar answered Sep 17 '22 16:09

yushulx