Text Recognition
After a successful scan or import of a document, you can get the detected text of the entire document or single pages.
Initialization
Docutain's Cordova SDK needs to be initialized prior to using any functionality of it as described here.
Get the detected text
In order to get the detected text of the entire document, call the following line of code:
- Cordova Promisify
- Cordova Callback
//...
//scan a document
//...
try{
const text = DocutainSDK.getText()
}catch (error) {
console.error(error);
}
//...
//scan a document
//...
const text = DocutainSDK.getText(function (text) {
}, error)
In order to get the detected text of a specific page, call the following line of code and specify the page number:
- Cordova Promisify
- Cordova Callback
//...
//scan a document
//...
try{
const text = DocutainSDK.getTextPage(1)
}catch (error) {
console.error(error);
}
//...
//scan a document
//...
const text = DocutainSDK.getTextPage(1, function (text) {
}, error)