@regulaforensics/ionic-native-document-reader 6.6.1 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/package.json +3 -3
- package/example/src/app/home/home.page.html +2 -2
- package/example/src/app/home/home.page.scss +8 -0
- package/example/src/app/home/home.page.ts +6 -7
- package/index.d.ts +113 -26
- package/index.js +338 -32
- package/ngx/index.d.ts +113 -26
- package/ngx/index.js +339 -33
- package/package.json +1 -1
- package/reactExample/package.json +3 -3
- package/reactExample/src/pages/Home.tsx +10 -11
package/package.json
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@awesome-cordova-plugins/image-picker": "^5.36.0",
|
|
17
17
|
"@ionic/react": "^6.0.0",
|
|
18
18
|
"@ionic/react-router": "^6.0.0",
|
|
19
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "6.
|
|
20
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.
|
|
21
|
-
"@regulaforensics/ionic-native-document-reader": "6.
|
|
19
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "6.7.2",
|
|
20
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullrfid": "6.7.0",
|
|
21
|
+
"@regulaforensics/ionic-native-document-reader": "6.7.0",
|
|
22
22
|
"@testing-library/jest-dom": "^5.11.9",
|
|
23
23
|
"@testing-library/react": "^11.2.5",
|
|
24
24
|
"@testing-library/user-event": "^12.6.3",
|
|
@@ -130,8 +130,6 @@ function handleCompletion(completion?: DocumentReaderCompletion) {
|
|
|
130
130
|
handleResults(completion.results!)
|
|
131
131
|
if (completion.action === Enum.DocReaderAction.TIMEOUT)
|
|
132
132
|
handleResults(completion.results!)
|
|
133
|
-
if (completion.action === Enum.DocReaderAction.CANCEL || completion.action === Enum.DocReaderAction.ERROR)
|
|
134
|
-
isReadingRfid = false
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
function showRfidUI() {
|
|
@@ -159,7 +157,7 @@ function restartRfidUI() {
|
|
|
159
157
|
|
|
160
158
|
function updateRfidUI(notification: DocumentReaderNotification) {
|
|
161
159
|
if (notification.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP)
|
|
162
|
-
rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(notification.
|
|
160
|
+
rfidDescription = Enum.eRFID_DataFile_Type.getTranslation(notification.dataFileType!)
|
|
163
161
|
rfidUIHeader = "Reading RFID"
|
|
164
162
|
rfidUIHeaderColor = "black"
|
|
165
163
|
rfidProgress = notification.value!
|
|
@@ -270,22 +268,22 @@ function handleResults(results: DocumentReaderResults) {
|
|
|
270
268
|
}
|
|
271
269
|
|
|
272
270
|
function displayResults(results: DocumentReaderResults) {
|
|
273
|
-
if(results == null) return
|
|
271
|
+
if (results == null) return
|
|
274
272
|
|
|
275
|
-
DocumentReader.
|
|
276
|
-
if(value != null){
|
|
273
|
+
DocumentReader.textFieldValueByType(results, Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES).then((value: string | undefined) => {
|
|
274
|
+
if (value != null) {
|
|
277
275
|
status.innerHTML = value
|
|
278
276
|
status.style.backgroundColor = "green"
|
|
279
277
|
}
|
|
280
278
|
})
|
|
281
279
|
|
|
282
|
-
DocumentReader.
|
|
283
|
-
if(value != null)
|
|
280
|
+
DocumentReader.graphicFieldImageByType(results, Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE).then((value: string | undefined) => {
|
|
281
|
+
if (value != null)
|
|
284
282
|
documentImage.src = "data:image/png;base64," + value
|
|
285
283
|
})
|
|
286
284
|
|
|
287
|
-
DocumentReader.
|
|
288
|
-
if(value != null)
|
|
285
|
+
DocumentReader.graphicFieldImageByType(results, Enum.eGraphicFieldType.GF_PORTRAIT).then((value: string | undefined) => {
|
|
286
|
+
if (value != null)
|
|
289
287
|
portraitImage.src = "data:image/png;base64," + value
|
|
290
288
|
})
|
|
291
289
|
}
|
|
@@ -311,7 +309,8 @@ function recognize() {
|
|
|
311
309
|
File.readAsDataURL((isPlatform("ios") ? "file://" : "") + results[0].substring(0, (results[0] as string).lastIndexOf("/")), results[0].substring((results[0] as string).lastIndexOf("/") + 1)).then((file => {
|
|
312
310
|
status.innerHTML = "processing image......"
|
|
313
311
|
status.style.backgroundColor = "grey"
|
|
314
|
-
|
|
312
|
+
let fileString = (file as string)
|
|
313
|
+
DocumentReader.recognizeImage(fileString.substring(fileString.indexOf(",") + 1)).subscribe((m: string) =>
|
|
315
314
|
handleCompletion(DocumentReaderCompletion.fromJson(JSON.parse(m))))
|
|
316
315
|
})).catch(error2)
|
|
317
316
|
}, error2)
|