Skip to main content

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

Initialize the Docutain Cordova Scanner SDK as described here and make sure you have followed the Getting started guide.

Get the detected text

In order to get the detected text of the entire document, call the following line of code:

//...
//scan a document
//...

try{
const text = await DocutainSDKPromisify.getText();
}catch (error) {
console.error(error);
}

In order to get the detected text of a specific page, call the following line of code and specify the page number:

//...
//scan a document
//...

try{
const text = await DocutainSDKPromisify.getTextPage(1);
}catch (error) {
console.error(error);
}