Skip to content

Commit

Permalink
Merge pull request #65 from Anyline/release/40.0.0
Browse files Browse the repository at this point in the history
Release/40.0.0
  • Loading branch information
rricarrdo authored Jun 22, 2022
2 parents 0b909b6 + 67ad683 commit 95becd0
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 12 deletions.
2 changes: 1 addition & 1 deletion example/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.anyline.examples.cordova" version="39.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="io.anyline.examples.cordova" version="40.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Anyline Cordova Example</name>
<preference name="deployment-target" value="12.0" />
<preference name="SwiftVersion" value="4.2" />
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anyline-cordova-example",
"version": "39.0.0",
"version": "40.0.0",
"description": "Cordova plugin for implementing Anyline",
"main": "index.js",
"scripts": {
Expand Down
18 changes: 12 additions & 6 deletions example/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,22 @@ <h2>Tire</h2>
<hr>
<h2> Vehicles </h2>
<p>
<input type="button" value="Vehicle Identification Nb." onclick="anyline.vin.scan()"
class="formButton" disabled=true/>
<br />
<input type="button" value="License Plates"
onclick="anyline.licensePlate.scanLicensePlates('LICENSE_PLATE')" class="formButton" disabled=true/>
onclick="anyline.licensePlate.scanLicensePlates('LICENSE_PLATE')" class="formButton" disabled=false/>
<br />
<input type="button" value="Tire Identification Nb." onclick="anyline.ocr.scanTin()"
class="formButton" disabled=true/>
<input type="button" value="License Plate US"
onclick="anyline.licensePlateUS.scanLicensePlates('LICENSE_PLATE')" class="formButton" disabled=false/>
<br />
<input type="button" value="License Plate Africa"
onclick="anyline.licensePlateAfrica.scanLicensePlates('LICENSE_PLATE')" class="formButton" disabled=false/>
</p>

<hr>
<h2>MRO</h2>
<input type="button" value="Vehicle Identification Nb." onclick="anyline.vin.scan()"
class="formButton" disabled=true/>
<br />
<p>
<input type="button" value="Universal Serial Number" onclick="anyline.usnr.scan()" class="formButton" disabled=true/>
<br />
<input type="button" value="Shipping Container" onclick="anyline.container.scan('default')" class="formButton" disabled=true/>
Expand Down Expand Up @@ -197,6 +201,8 @@ <h2> Workflows </h2>
<script type="text/javascript" src="js/anyline.tire.js"></script>
<script type="text/javascript" src="js/anyline.document.js"></script>
<script type="text/javascript" src="js/anyline.licensePlate.js"></script>
<script type="text/javascript" src="js/anyline.licensePlateUS.js"></script>
<script type="text/javascript" src="js/anyline.licensePlateAfrica.js"></script>
<script type="text/javascript" src="js/anyline.vin.js"></script>
<script type="text/javascript" src="js/anyline.usnr.js"></script>
<script type="text/javascript" src="js/anyline.container.js"></script>
Expand Down
117 changes: 117 additions & 0 deletions example/www/js/anyline.licensePlateAfrica.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Anyline Cordova Plugin
* anyline.ocr.js
*
* Copyright (c) 2016 Anyline GmbH
*/

if (anyline === undefined) {
var anyline = {};
}
anyline.licensePlateAfrica = {
onResult: function (result) {
changeLoadingState(false);
//this is called for every mrz scan result
//the result is a json-object containing all the scaned values and check-digits

console.log("Result: " + JSON.stringify(result));
console.log("Result: " + result.country);
console.log("Result: " + result.licensePlate);

var div = document.getElementById('results');

if(div.childElementCount >= 3) {
div.removeChild(div.childNodes[div.childElementCount - 1]);
}

div.innerHTML = "<p>" + "<img src=\"" + result.imagePath + "\" width=\"100%\" height=\"auto\"/>" +
"<br/><i><b>Country:</b> " + result.country + "</i>" +
"<br/><i><b>LicensePlate:</b> " + result.licensePlate + "</i>" +
"<br/><i><b>Confidence:</b> " + result.confidence + "</i>" +
"<br/><i><b>Outline Points:</b> " + result.outline + "</i>" +
div.innerHTML;

document.getElementById("details_scan_modes").removeAttribute("open");
document.getElementById("details_results").setAttribute("open", "");
window.scrollTo(0, 0);
},

onError: function (error) {
changeLoadingState(false);
//called if an error occurred or the user canceled the scanning
if (error == "Canceled") {
//do stuff when user has canceled
// this can be used as an indicator that the user finished the scanning if canclelOnResult is false
console.log("AnylineOcr scanning canceled");
return;
}

alert(error);
},

licenseKey:"ew0KICAibGljZW5zZUtleVZlcnNpb24iOiAiMy4wIiwNCiAgImRlYnVnUmVwb3J0aW5nIjogInBpbmciLA0KICAibWFqb3JWZXJzaW9uIjogIjM3IiwNCiAgInNjb3BlIjogWw0KICAgICJBTEwiDQogIF0sDQogICJtYXhEYXlzTm90UmVwb3J0ZWQiOiA1LA0KICAiYWR2YW5jZWRCYXJjb2RlIjogdHJ1ZSwNCiAgIm11bHRpQmFyY29kZSI6IHRydWUsDQogICJzdXBwb3J0ZWRCYXJjb2RlRm9ybWF0cyI6IFsNCiAgICAiQUxMIg0KICBdLA0KICAicGxhdGZvcm0iOiBbDQogICAgImlPUyIsDQogICAgIkFuZHJvaWQiLA0KICAgICJXaW5kb3dzIg0KICBdLA0KICAic2hvd1dhdGVybWFyayI6IHRydWUsDQogICJ0b2xlcmFuY2VEYXlzIjogMzAsDQogICJ2YWxpZCI6ICIyMDIyLTEyLTEyIiwNCiAgImlvc0lkZW50aWZpZXIiOiBbDQogICAgImlvLmFueWxpbmUuZXhhbXBsZXMuY29yZG92YS5iZXRhIiwNCiAgICAiaW8uYW55bGluZS5leGFtcGxlcy5jb3Jkb3ZhIiwNCiAgICAiaW8uYW55bGluZS5leGFtcGxlcy5jb3Jkb3ZhLmdpdGh1YiINCiAgXSwNCiAgImFuZHJvaWRJZGVudGlmaWVyIjogWw0KICAgICJpby5hbnlsaW5lLmV4YW1wbGVzLmNvcmRvdmEiDQogIF0sDQogICJ3aW5kb3dzSWRlbnRpZmllciI6IFsNCiAgICAiaW8uYW55bGluZS5leGFtcGxlcy5jb3Jkb3ZhIg0KICBdDQp9CmhWYktnRE1GSis0RWE0ZXU2dEord2c1NjFGR25UdzNSV2dTZGdTZjliTlZyRitiOXdUVGJPVERZazM5UFBuWHAxTXh4bWVrc3BvcXJtcEt3SnlYSHBkOEJnQktHazdKZkxLOTl1d1BYRFpjS2dDNVlOTTFkS0c0TmQzSFdhSHdkOUUvZlZtQ3dNWGtXMFgvaE1FNlpod3NOYzZoaWRmcVZiRVI2SWZoRVhnWHNzS1Y1ckxzSjJYSzZQc01NMG9JbzR4dnp5WGtOS05sL0wxNDgybnFCQ2RZckxBWnBrS1RMT05BcnhLY3poV20rS3ZuV05uRU1JQ2c2NlBLemMwT3VmT05JUFJPeTIzanl6cnM0Wjh1RG92WC9pNmFXenlXS0o2bkpXd0E1OE5CVC9KS0txck1DYXdrT2cxblRiMVM3cEkwU1cvdVZTZzBLY1E1Y3RVaGNPdz09",

anylineLicensePlateViewConfig: {
"camera" : {
"captureResolution" : "1080p",
"zoomGesture" : true
},
"flash" : {
"mode" : "manual",
"alignment" : "top_left"
},
"viewPlugin" : {
"plugin" : {
"id" : "LicensePlate_ID",
"licensePlatePlugin" : {
"scanMode" : "africa"
}
},
"cutoutConfig" : {
"style": "rect",
"maxWidthPercent": "80%",
"maxHeightPercent": "80%",
"alignment": "top_half",
"width": 720,
"ratioFromSize": {
"width": 2,
"height": 1
},
"strokeWidth": 2,
"cornerRadius": 10,
"strokeColor": "FFFFFF",
"outerColor": "000000",
"outerAlpha": 0.3,
"feedbackStrokeColor": "0099FF"
},
"scanFeedback" : {
"animationDuration": 0,
"style": "RECT",
"strokeWidth": 2,
"strokeColor": "0099FF",
"blinkOnResult": true,
"beepOnResult": true,
"vibrateOnResult": true
},
"cancelOnResult" : true,
"delayStartScanTime":2000
}
},

scanLicensePlates: function () {
// start the Anyline OCR scanning
// pass the success and error callbacks, as well as the license key and the config to the plugin
// see http://documentation.anyline.io/#anyline-config for config details
// and http://documentation.anyline.io/#anylineOcrModule for module details

if (localStorage.getItem("hasStartedAnyline") === 'true') {
return;
}
changeLoadingState(true);

cordova.exec(this.onResult, this.onError, "AnylineSDK", "scan", [
this.licenseKey,
this.anylineLicensePlateViewConfig
]);
}
};
117 changes: 117 additions & 0 deletions example/www/js/anyline.licensePlateUS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Anyline Cordova Plugin
* anyline.ocr.js
*
* Copyright (c) 2016 Anyline GmbH
*/

if (anyline === undefined) {
var anyline = {};
}
anyline.licensePlateUS = {
onResult: function (result) {
changeLoadingState(false);
//this is called for every mrz scan result
//the result is a json-object containing all the scaned values and check-digits

console.log("Result: " + JSON.stringify(result));
console.log("Result: " + result.country);
console.log("Result: " + result.licensePlate);

var div = document.getElementById('results');

if(div.childElementCount >= 3) {
div.removeChild(div.childNodes[div.childElementCount - 1]);
}

div.innerHTML = "<p>" + "<img src=\"" + result.imagePath + "\" width=\"100%\" height=\"auto\"/>" +
"<br/><i><b>Country:</b> " + result.country + "</i>" +
"<br/><i><b>LicensePlate:</b> " + result.licensePlate + "</i>" +
"<br/><i><b>Confidence:</b> " + result.confidence + "</i>" +
"<br/><i><b>Outline Points:</b> " + result.outline + "</i>" +
div.innerHTML;

document.getElementById("details_scan_modes").removeAttribute("open");
document.getElementById("details_results").setAttribute("open", "");
window.scrollTo(0, 0);
},

onError: function (error) {
changeLoadingState(false);
//called if an error occurred or the user canceled the scanning
if (error == "Canceled") {
//do stuff when user has canceled
// this can be used as an indicator that the user finished the scanning if canclelOnResult is false
console.log("AnylineOcr scanning canceled");
return;
}

alert(error);
},

licenseKey:"ew0KICAibGljZW5zZUtleVZlcnNpb24iOiAiMy4wIiwNCiAgImRlYnVnUmVwb3J0aW5nIjogInBpbmciLA0KICAibWFqb3JWZXJzaW9uIjogIjM3IiwNCiAgInNjb3BlIjogWw0KICAgICJBTEwiDQogIF0sDQogICJtYXhEYXlzTm90UmVwb3J0ZWQiOiA1LA0KICAiYWR2YW5jZWRCYXJjb2RlIjogdHJ1ZSwNCiAgIm11bHRpQmFyY29kZSI6IHRydWUsDQogICJzdXBwb3J0ZWRCYXJjb2RlR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ureResolution" : "1080p",
"zoomGesture" : true
},
"flash" : {
"mode" : "manual",
"alignment" : "top_left"
},
"viewPlugin" : {
"plugin" : {
"id" : "LicensePlate_ID",
"licensePlatePlugin" : {
"scanMode" : "unitedStates"
}
},
"cutoutConfig" : {
"style": "rect",
"maxWidthPercent": "80%",
"maxHeightPercent": "80%",
"alignment": "top_half",
"width": 720,
"ratioFromSize": {
"width": 2,
"height": 1
},
"strokeWidth": 2,
"cornerRadius": 10,
"strokeColor": "FFFFFF",
"outerColor": "000000",
"outerAlpha": 0.3,
"feedbackStrokeColor": "0099FF"
},
"scanFeedback" : {
"animationDuration": 0,
"style": "RECT",
"strokeWidth": 2,
"strokeColor": "0099FF",
"blinkOnResult": true,
"beepOnResult": true,
"vibrateOnResult": true
},
"cancelOnResult" : true,
"delayStartScanTime":2000
}
},

scanLicensePlates: function () {
// start the Anyline OCR scanning
// pass the success and error callbacks, as well as the license key and the config to the plugin
// see http://documentation.anyline.io/#anyline-config for config details
// and http://documentation.anyline.io/#anylineOcrModule for module details

if (localStorage.getItem("hasStartedAnyline") === 'true') {
return;
}
changeLoadingState(true);

cordova.exec(this.onResult, this.onError, "AnylineSDK", "scan", [
this.licenseKey,
this.anylineLicensePlateViewConfig
]);
}
};
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io-anyline-cordova",
"version": "39.0.0",
"version": "40.0.0",
"description": "The cordova plugin for the Anyline SDK",
"cordova": {
"id": "io-anyline-cordova",
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="io-anyline-cordova"
version="39.0.0">
version="40.0.0">

<name>AnylineSDK</name>

Expand Down Expand Up @@ -44,7 +44,7 @@
<!-- <resource-file src="src/ios/anyline_sdk/AnylineResources.bundle"/>-->

<!-- Anyline Framework & Resource Bundle CocoaPods -->
<framework src="Anyline" type="podspec" swift-version="4.2" spec="~> 39.0.0"/>
<framework src="Anyline" type="podspec" swift-version="4.2" spec="~> 40.0.0"/>

<!-- <podspec>
<config>
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/android/anyline.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories{
}

dependencies {
implementation 'io.anyline:anylinesdk:39.0.0'
implementation 'io.anyline:anylinesdk:40.0.0'
}

android {
Expand Down

0 comments on commit 95becd0

Please sign in to comment.