Cordova Plugin - startDataCapture options profile - ID_HK

  • 194 Views
  • Last Post 17 December 2018
ryanalbartus posted this 27 November 2018

Hi All ~ 

After finished the "Getting started", I can call "startTextCapture" to capture the text.

Now I am testing the startDataCapture function on the ionic 3 project. 

Below is my code : 

 ======================================

openDataCapture(){

    const options = {

      profile : 'ID_HK',

      licenseFileName : 'SRTT-0000-0000-0000-0000-0000.License'

    };

 

    this.abbyyRTR.startDataCapture(options)

    .then((res: any) => alert(JSON.stringify(res)))

    .catch((error: any) => alert(JSON.stringify(error)));

  }

 ====================================== 

But I got the Error Message: Unsupported profile: 'ID_HK'. Service cannot be created. 

 (It show at the top of the camera preview with red font color )

May I know how can I set the HKID profile?


Related Document and Link : 

https://cdn.jsdelivr.net/npm/cordova-plugin-abbyy-rtr-sdk@1.0.8/RtrSdkCordovaDevelopersGuide.pdf

https://rtrsdk.com/documentation/specifications/data-capture-profiles/

https://github.com/abbyysdk/RTR-SDK.Cordova

Order By: Standard | Newest | Votes
Oksana S. posted this 03 December 2018

Hi,

We have requested additional information by email within your support ticket.

Looking forward to hearing from you.

  • Liked by
  • ryanalbartus
ryanalbartus posted this 11 December 2018

Hi Oksana ~
Thank you for your support!!

We also want more information about  Custom Data Field.

We are following the structure of Capture a Custom Data Field with iOS : 

https://rtrsdk.com/documentation/ios/how-to/custom-data-capture/

It is work for the Single custom data field capture.

 

May I know the SDK also support the Multiple custom data field capture???



Regards,
Ryan

Oksana S. posted this 12 December 2018

Hi Ryan,

The Custom Data Field Capture scenario allows to extract only one field which can be described by regular expression and can consist of only one line. To extract several regular fields you have to do it one-by-one. According to our product analyst, there is no plans to extend this functionality so far.

  • Liked by
  • ryanalbartus
ryanalbartus posted this 14 December 2018

Hi Oksana ~

Thank you for your support again !!

For the Custom Data Field, I can recognise almost all HKID value but the English Name.

 

The is my regExp : [A-Z]+(, )(([A-Z])([a-z ])*)*

It tested with this website : https://www.regextester.com/

And my testing image is my HKID and this sample ID : 

https://upload.wikimedia.org/wikipedia/en/2/23/HKID_pic-adult-front_sample.jpg

 

After trying several times, I found that  " * " (Zero or more) is NOT working on the SDK.

 

I was wondering if you could give me some advice.

Oksana S. posted this 14 December 2018

Hi,

Have you finally managed to run your application using our Data Capture scenario with the ID_HK profile? Does it work well?

Regarding your question about regular expressions, please try to use Unicode character, as it is described in the Regular Expressions section of the documentation.

ryanalbartus posted this 17 December 2018

Hi Oksana Serdyuk,

 

For the native Android and iOS, they are working with the ID_HK profile.

For the regular expressions, we also solved the issue.

 

Now we will force on ABBYY Real-Time Recognition SDK Cordova Plugin

https://github.com/abbyysdk/RTR-SDK.Cordova

 

We have an issue on the link / embed "AbbyyRtrSDK.framework" to the sample project(cordova-plugin-abbyy-rtr-sdk-sample).

 

Here is the step that we tested with sample code : 

Xcode version: 10.1

Device: MacBook Pro

Target Device : iPad / iPad mini

 

1. Download and unzip the RTR-SDK.Cordova-master.zip

2. cd cordova-plugin-abbyy-rtr-sdk-sample

3. cordova plugin add ../cordova-plugin-abbyy-rtr-sdk

4. Download and unzip the latest SDK : abbyy-mi-rtr-sdk-5.0.6.49-iOS-ExtendedDC (Provided from Sales Team)

5. Copy Framework to /libs/ios/

From : abbyy-mi-rtr-sdk-5.0.6.49-iOS-ExtendedDC/libs/AbbyyRtrSDK.framework

To : /cordova-plugin-abbyy-rtr-sdk-sample/libs/ios/

6. Copy the All Patterns to /rtr_assets/Patterns/  and update the index.js with Profile :  ID_HK :

From : abbyy-mi-rtr-sdk-5.0.6.49-iOS-ExtendedDC/assets/patterns/

To : /cordova-plugin-abbyy-rtr-sdk-sample/www/rtr_assets/Patterns/

7. Copy the Dictionaries to /rtr_assets/Dictionaries/

From : abbyy-mi-rtr-sdk-5.0.6.49-iOS-ExtendedDC/assets/dictionaries/

To : /cordova-plugin-abbyy-rtr-sdk-sample/www/rtr_assets/Dictionaries/

8. Copy the License file and update the index.js with the License file name :

Form : SRTT-XXXX-XXXX-XXXX-XXXX-XXXX.ABBYY.License

To : /cordova-plugin-abbyy-rtr-sdk-sample/www/rtr_assets

9. cordova platform add ios

10. Add `libs/ios` to linker search paths:

File : /cordova-plugin-abbyy-rtr-sdk-sample/platforms/ios/cordova/build.xcconfig

Add : FRAMEWORK_SEARCH_PATHS = "../../libs/ios"

11. cordova build ios ⇐= (Has no add --buildFlag="DEVELOPMENT_TEAM=<YOUR_TEAM>" like the Getting started instruction)

Issue :

1. Open the project in xcode and the ABBYY SDK framework is RED

2. The project is built successfully but has a runtime error : 

Library not loaded: @rpath/AbbyyRtrSDK.framework/AbbyyRtrSDK

Referenced from: /Users/ryanalbartus/Library/Developer/CoreSimulator/Devices/B291694C-A9F5-459E-88AB-1D4E393C37E9/data/Containers/Bundle/Application/4FDF7312-F505-4735-A523-9D9A306C4D63/RTRCordovaSample.app/RTRCordovaSample

  Reason: image not found

3. We also try to add .framework manually, like below image: 

 



Results: It is built success but has below error : 

 

dyld: Library not loaded: @rpath/AbbyyRtrSDK.framework/AbbyyRtrSDK

  Referenced from: /Users/ryanalbartus/Library/Developer/CoreSimulator/Devices/B291694C-A9F5-459E-88AB-1D4E393C37E9/data/Containers/Bundle/Application/34E53180-4268-45AA-A61C-5C83477A0760/RTRCordovaSample.app/RTRCordovaSample

 

  Reason: image not found


 

 

4. We also try to embed .framework manually, like below image: 




Result: It is built success and app can build at the device
But after click on the "TEXT CAPTURE" button or "MRZ" button, the app will crash : (we also tested All License file that Sales Team provided ). And the result is the same as the below image : 




Close