Database stores the documents' data. It's mandatory to have db.dat
file if type of the document, OCR zone information should be recognized. If MRZ, Barcode recognition or image cropping are used, there is no need to have the db.dat
file.
After db.dat is added, it'll be unpacked and a few new files will be created.
The options to get the db.dat
file are presented below.
You can manually add database to the project. First of all, follow the next link licensing.regulaforensics.com, select page "Databases" and download the db.dat
file. Copy the database to the www
folder. Insert the lines below to the config.xml
file.
<platform name="android"><resource-file src="www/db.dat" target="app/src/main/assets/Regula/db.dat"/></platform>
<platform name="ios"><resource-file src="www/db.dat" /></platform>
To reduce your package size database (db.dat
file) can be obtained from the network. In order to download db.dat
file you should know its identifier, all database identifiers you can find on https://licensing.regulaforensics.com.
DocumentReader.prepareDatabase("Full", function (message) {console.log(message);}, function (error) {console.log(error);});
When operation is completed successfully, db.dat
file will get to resources in the same way as if you add it manually. This operation should be run before initialization process.
For getting always the latest version of database you can run autoupdate function:
DocumentReader.runAutoUpdate("Full", function (message) {console.log(message);}, function (error) {console.log(error);});
When operation is completed successfully, db.dat
file will get to resources after update and will be used in next initialization.
Allows to remove the added database:
DocumentReader.removeDatabase(function (message) {console.log(message);}, function (error) {console.log(error);});
Allows to cancel database update:
DocumentReader.cancelDBUpdate(function (message) {console.log(message);}, function (error) {console.log(error);});