Version 7.0
The repository aims to help developers build Node.js barcode apps with Dynamsoft Barcode Reader in Windows, Linux, macOS, and Raspberry Pi.
Get the trial license.
Node v8.11.3
-
node-gyp
npm i node-gyp -g
Change directory to src.
cd src
Edit binding.gyp. Replace E:\\Program Files (x86)\\Dynamsoft\\Barcode Reader 7.0\\Components\\C_C++\\Lib\\DBRx64.lib and E:\\Program Files (x86)\\Dynamsoft\\Barcode Reader 7.0\\Components\\C_C++\\Redist\\x64\\ with yours.
Build the Node.js extension:
node-gyp configure
node-gyp build
For Visual Studio 2019 Community
node-gyp configure --msbuild_path="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" --msvs_version=2017
node-gyp build
Change directory to src.
cd src
Edit binding.gyp. Replace /mnt/g/nodejs/libDynamsoftBarcodeReader.so or /mnt/g/nodejs/libDynamsoftBarcodeReader.dylib with yours.
Build the Node.js extension:
node-gyp configure
node-gyp build
-
examples/command-line
node test.js -f test.tif -
examples/web
npm install node server.jsOpen
http://localhost:2018/index.htmin web browsers. -
examples/desktop-electron
cd src node-gyp rebuild --target=0.36.7 --arch=x64 --dist-url=https://atom.io/download/atom-shell cd examples/desktop-electron npm install npm start -
examples/linux-camera
npm install v4l2camera node camera_barcode_reader.js -
examples/RESTful-service
npm install restify node server.jsOpen
https://< ip >:2018to scan barcodes in web browsers.
https://www.dynamsoft.com/help/Barcode-Reader/devguide/Template/TemplateSettingsList.html
The simplest way to set barcode types:
var barcodeTypes = dbr.formats.OneD;
decodeFileAsync(fileName, barcodeTypes, callback);Alternatively, you can use template:
// From file
template = fs.readFileSync("<template file>");
// From JSON object
let params = {
"Version": "2.0",
"ImageParameter": {
"Name": "Custom_143301_827",
"BarcodeFormatIds": [
"PDF417"
],
"ExpectedBarcodesCount": 9,
"ScaleDownThreshold": 1200000,
"BinarizationBlockSize": 5
}
};
template = JSON.stringify(params);
decodeFileAsync(fileName, 0, callback, template);- How to Wrap Dynamsoft Linux Barcode SDK for Node.js
- How to Build Node.js Barcode Reader on Raspberry Pi
- Node.js Barcode Scanner with UVC Camera for Raspberry Pi
- How to Make Node Barcode Reader Addon on Linux
- Making Online Barcode Reader on Linux with Node.js
- Making Dynamsoft Barcode SDK an Addon for Node.js
- How to Make Web Barcode Reader with NodeJS REST Framework