Initialization
This page covers the description of the initialization process
The DocumentReader initialization works fully offline. It simply use license file, which you can get here: licensing.regulaforensics.com. You should add the regula.license file to your project.
1
var app = this
2
app.platform.ready().then(() => {
3
readFile("", "regula.license", (license) => {
4
DocumentReader.initializeReader(license).then(m => console.log(m)).catch(error)
5
})
6
})
7
8
function readFile(dirPath: string, fileName: string, callback, ...items) {
9
File.resolveDirectoryUrl(File.applicationDirectory + dirPath).then(dir => File.getFile(dir, fileName, null).then(fileEntry => fileEntry.file(file => {
10
var reader = new FileReader()
11
reader.onloadend = (evt) => {
12
var data = reader.result as String
13
data = data.substring(data.indexOf(',') + 1)
14
callback(data, items)
15
}
16
reader.readAsDataURL(file)
17
})))
18
}
Copied!
Last modified 11mo ago
Copy link