Using Block method to apply recognizer settings to a separate rectangle of text on a document using FineReader Engine

Question

Is it possible to apply a separate set of settings to a block of text on the document?

Answer

We need to create a rectangle around the dedicated block of text and apply settings to it as presented on the code sample below.

//Create and specify the region 
IRegion region = engineLoader.Engine.CreateRegion();

region.AddRect(myregion);
//Create block and specify type
IBlock block = document.Pages[0].Layout.Blocks.AddNew(BlockTypeEnum.BT_Text, region, 0);
//Specify text block
ITextBlock textblock = block.GetAsTextBlock();
//We can specify ObjectExtractionParams and PagePreprocessing as well

textblock.RecognizerParams.SetPredefinedTextLanguage("English");
//Because we specified separate block of text we need to Synthesize document instead of Process

document.Recognize();
document.Synthesize();

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.