Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
io-anyline-cordova
Advanced tools
_____ _ _
| _ |___ _ _| |_|___ ___
| | | | | | | | -_|
|__|__|_|_|_ |_|_|_|_|___|
|___|
Anyline is mobile OCR SDK, which can be configured by yourself to scan all kinds of numbers, characters, text and codes.
The plugin lets you connect to the SDK with React-Native.
Go to the Example project in the example folder.
Check out the examples ResultView.js and config.json to see the implementation.
Go to our pricing page and get your license or sign up for your expiring test license.
Download or Clone the Repo to your node_modules
project
│ android.index.js
│ ios.index.js
└─── node_modules
└─── anyline-ocr-react-native-module
or just go
npm i anyline-ocr-react-native-module
Link the project. Run in root:
react-native link
in the root folder.
Package name must match with the bundleID from your Anyline License.
Go into the native Android folder of your Project to your MainApplication.
Import the AnylinePackage
import com.anyline.reactnative.AnylinePackage;
and add the package to your getPackages function
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AnylinePackage()
);
}
Strict mode does not allow function declarations in a lexically nested statement.
http://stackoverflow.com/a/41076153/2157717
duplicate files during packaging of APK
packagingOptions {
pickFirst 'lib/armeabi-v7a/libgnustl_shared.so'
pickFirst 'lib/x86/libgnustl_shared.so'
}
Disable bitcode in your project
pod update
Add Camera Permissions to Info.plist
Privacy - Camera Usage Description
Add also every other permission you want to configure in your config.js (vibrate, sound).
Your BundleIdentifier of your app has to match with your bundleID from your Anyline License.
import Anyline from 'anyline-ocr-react-native-module';
import config from './config.js';
Add and import a JSON file with the proper structure and elements. The JSON config contains:
The license key
Options field with
If you want to get detailed information on the config JSON, go to ourdocumentation
.
AnylineOCR.setupScanViewWithConfigJson(
JSON.stringify(config),
“ANALOG_METER”,
this.onResult,
this.onError
);
openAnyline = async () => {
...
try {
const result = await AnylineOCR.setupScanViewWithConfigJson(JSON.stringify(config), “ANALOG_METER”);
} catch(error) {
console.error(error);
}
...
}
If you want to add you custom traindata, you have to copy it into the native project folder.
ios
└─── trainedData
└─── myTrainedData.traineddata
android
└─── app
└─── src
└─── main
└─── assets
└─── traindData
└─── myTrainedData.traineddata
Also the OCR Config has to reflect the path.
Key | Type | Default | Description |
---|---|---|---|
config | string | *required | config (JSON String) |
scanMode | string | *required | Will set the scanMode/Module of the Plugin. |
onResult | function | *required | The function you pass will be the onResult callback. Use this callback to handle the found scan results. |
onError | function | *required | The onError function will be called when the AnylinePlugin encounters an error. Handle the error messages in this method. |
Stringified JSON with all the configurations, detailed information here.
Keep in mind, that you have to add every permission to your project, you add in the config (vibrateOnResult -> vibration permission)
Available settings:
"AUTO_ANALOG_DIGITAL_METER"
"ANALOG_METER"
"DIGITAL_METER"
"DIAL_METER"
"HEAT_METER_4"
"HEAT_METER_5"
"HEAT_METER_6"
"SERIAL_NUMBER"
"BARCODE"
"MRZ"
"ANYLINE_OCR"
"DOCUMENT"
"LICENSE_PLATE"
Get more information in our Docu.
Callback -> Stringified JSON
{
reading : 'Result of the Scan',
imagePath : 'path to cropped image',
fullImagePath : 'path to full image',
barcode : 'result of the simultaneous barcode scanning',
scanMode : 'selected scanMode',
meterType : 'meter type'
}
More information about the simultaneous barcode scanning here.
Callback -> String
Keep in mind, all the images are saved in the cache directory of the app. For performance reasons, we only provide the path as string, so we don't have to transfer the whole image through the bridge. Please be aware, that you should not use the images in the cache directory for persistent storage, but store the images in a location of your choice for persistence.
See LICENSE file.
FAQs
The Cordova plugin for the Anyline SDK.
The npm package io-anyline-cordova receives a total of 325 weekly downloads. As such, io-anyline-cordova popularity was classified as not popular.
We found that io-anyline-cordova demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.