FRE 12 - OCR SDK - Language from documentViewer dropdown list

  • 81 Views
  • Last Post 04 March 2019
foodlogistix posted this 28 February 2019

I want to read the pages of document, after I imported a layout template. My code for loading template is:

for (int i = 0; i < Synchronizer.Document.Pages.Count; i++)
{
Synchronizer.Document.Pages.Item(i).Layout.LoadFromFile(openTemplateDialog.FileName);
Synchronizer.Document.Pages.Item(i).Synthesize();
Synchronizer.DocumentViewer.Commands.DoCommand(FineReaderVisualComponents.MenuItemEnum.MI_NextPage, true);

}

 

And when I want to read the pages, I select all the recognition areas (blocks) and read them in a following manner:

 

FREngine.IIntsCollection selectedPages = documentViewer.SelectedPagesIndices;
                    foreach (int selectedPage in selectedPages)

                    {
                        imageViewer.Commands.DoCommand(FineReaderVisualComponents.MenuItemEnum.MI_SelectAll, true);
                        imageViewer.Commands.DoCommand(FineReaderVisualComponents.MenuItemEnum.MI_BlockType_Text, true);
                        imageViewer.Commands.DoCommand(FineReaderVisualComponents.MenuItemEnum.MI_ReadBlock, true);

                        documentViewer.Commands.DoCommand(FineReaderVisualComponents.MenuItemEnum.MI_NextPage, true);
                    }

 

Regardless of a language I choose from a dropdown list in documentviewer all the blocks's language is English.

I have found out that if I change manually the properties of a block in the ImageViewer and set language to 'Default' and then I read it again it will change to Polish, which is the one I chose previously in DocumentViewer.

Is there a way to 'apply' a DEFAULT recognition language to all the selected textblocks in ImageViewer??

A variable(selectedItem) of languagePane in documentviewer?

Could you give me some hints?

 

Nadezhda A. Solovyeva posted this 04 March 2019

Dear customer,

We apologize for this issue in our product. Unfortunately, during save/load operation, FineReader Engine does not apply the visual block properties unless it was set to something different from the default. This is caused by an internal Engine structure. Our developers are already working on it.

I was unable to reproduce your particular issue, but a common workaround is setting the block properties manually:

foreach (int blockIndex in imageViewer.GetSelectedBlocksIndices()){
Synchronizer.Document.Pages[imageViewer.SelectedPagesIndices[0]].Layout.Blocks[blockIndex].GetAsTextBlock().RecognizerParams.SetPredefinedTextLanguage("YourTargetLanguage");
}

If this does not solve your issue, then please send the full information to our technical support by e-mail (the address is listed in ABBYY website "Contacts" section for your region).

 

Close