Visual Basic (Declaration) | |
---|---|
Public Interface IOcrTableZoneManager |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As IOcrTableZoneManager |
C# | |
---|---|
public interface IOcrTableZoneManager |
C++/CLI | |
---|---|
public interface class IOcrTableZoneManager |
You can access the IOcrTableZoneManager of an OCR page through the IOcrPage.TableZoneManager property. If the value of this property is null (Nothing in Visual Basic), then the current OCR engine does not support table cell manipulation.
You can use table cells in one of two ways:
-
Perform auto-zoning on the page using IOcrPage.AutoZone, if the page contains a detected table, the a zone of type OcrZoneType.Table is created for this table. If the engine successfully detects the cells of the table, then it will fill the OcrZone.Cells with the properties of the detected cells.
-
Manually add a new Leadtools.Forms.Ocr.OcrZone with its type set to OcrZoneType.Table to the zones collection of a page. Leave the value of OcrZone.Cells to null (Nothing in Visual Basic), now use the IOcrTableZoneManager.AutoDetectCells method to instruct the engine to detect any cells in this zone and fill the array with the data.
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.
Manipulating cells position and size inside a table zone is a very sensitive matter and any non-accurate information will cause an error. The IOcrTableZoneManager contains methods to easily accomplish these tasks with minimum error. These methods are built around what is expected to be accomplished by an application that manipulates the cells of a zone through a user-interface, such as clicking and dragging with the mouse.
The following methods can be used to manipulate the cells position and size:
-
SplitCells and merge cells to split/merge the cells inside a given area in a table zone. This makes it easy to add/remove cells to the zone.
-
GetPointInformation to Gets the cell index and the nearest border for a given point. This can be used by selecting a cell or a border using a mouse click.
-
MoveCellBorder and GetCellBorderDragLimit to move a cell border while making sure it does not get run over adjuscent cells or the table area. This can be used to change the size of a cell by clicking and dragging the mouse.
-
GetTabulatorPosition to get the tabulator position. The tabulator has only a horizontal position.
-
GetHorizontalSplitters and GetVerticalSplitters to get the number and positions of horizontal and vertical splitters. You can these methods to draw splitter guidelines in your user interface, or change the mouse cursor to a different shape if it is located over a splitter and dragging is allowed.
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7