LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

GetSupportedCellTypes Method

Show in webframe
Example 







Gets the cell types supported by this OCR engine.
Syntax
OcrZoneType[] GetSupportedCellTypes()
'Declaration
 
Function GetSupportedCellTypes() As OcrZoneType()
'Usage
 
Dim instance As IOcrTableZoneManager
Dim value() As OcrZoneType
 
value = instance.GetSupportedCellTypes()
OcrZoneType[] GetSupportedCellTypes()

            

            
function Leadtools.Forms.Ocr.IOcrTableZoneManager.GetSupportedCellTypes()
array<OcrZoneType>^ GetSupportedCellTypes(); 

Return Value

An array of OcrZoneType enumeration members that specify the cell types supported by this OCR engine.
Remarks

Currently, on the LEADTOOLS Professional OCR engine support manipulating the cells of a table zone. When using this engine, this method will return an array containing the following:

These are the only cell types that may be returned from the engine when table cells are auto-detected or you can manually set into OcrZoneCell.CellType. Setting any other cell type will result in an exception being thrown.

In the future, this restriction might be removed when more cell types are supported, it is recommended that you use GetSupportedCellTypes to programatically get a list of the supported types and construct and user interface from the values returned from this method (for example, a combo box for cell type selection in your application).

You can use table cells in one of two ways:

To manipulate a cell properties other than its bound (OcrZoneCell.Bounds), get the array of detected cells through OcrZone.Cells, change the cell background color, style or any border color, style or with. When you are done, re-set the array to OcrZone.Cells and call IOcrTableZoneManager.UpdateCells.

It is not recommended that you manually remove or add cells to the OcrZone.Cells, the engine is very sensitive to zone boundaries and any non-accurate information will cause an error. Instead, use the various methods of IOcrTableZoneManager to manipulate the cell location and size.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Drawing

Private Shared Sub GetSupportedCellTypesExample(ByVal ocrPage As IOcrPage)
   Console.WriteLine("The engine of type {0} supports these zone cell types:", ocrPage.Document.Engine.EngineType)
   Dim ocrTableZoneManager As IOcrTableZoneManager = ocrPage.TableZoneManager
   If Not IsNothing(ocrTableZoneManager) Then
      Dim cellTypes() As OcrZoneType = ocrTableZoneManager.GetSupportedCellTypes()
      For Each cellType As OcrZoneType In cellTypes
         Console.WriteLine(cellType.ToString())
      Next
   Else
      Console.WriteLine("Cells not supported.")
   End If
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Drawing;

private static void GetSupportedCellTypesExample(IOcrPage ocrPage)
{
   Console.WriteLine("The engine of type {0} supports these zone cell types:", ocrPage.Document.Engine.EngineType);
   IOcrTableZoneManager ocrTableZoneManager = ocrPage.TableZoneManager;
   if(ocrTableZoneManager != null)
   {
      OcrZoneType[] cellTypes = ocrTableZoneManager.GetSupportedCellTypes();
      foreach(OcrZoneType cellType in cellTypes)
      {
         Console.WriteLine(cellType.ToString());
      }
   }
   else
   {
      Console.WriteLine("Cells not supported.");
   }
}
Requirements

Target Platforms

See Also

Reference

IOcrTableZoneManager Interface
IOcrTableZoneManager Members
OcrZoneCell Class
OcrZoneCell.CellType

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

GetSupportedCellTypes requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features