GetWorktextForPageArea

This method returns a worktext object from a specific location on a document. The worktext object contains text and positional information relating to the area specified in GetWorktextForPageArea. You can view this as a temporary zone to read a piece of information through a script and review the returned result for that area.

The area to search starts from Left and Top coordinates and finishes at Width and Height coordinates. These are the same coordinates that you would enter for a reading zone. For more information, see "Modify the general zone properties" in the Brainware Intelligent Capture Designer Help.

Note: Use a zone to test the page area coordinates.

Syntax

GetWorktextForPageArea(Page as Long, Left as Long, Top as Long, Width as Long, Height as Long, IncludePartial as Boolean)
Parameter Description
Page Page number of the image. 0 represents the first page of a multi-page document.
Left Left coordinate of the page area in pixels.
Top Top most coordinate of the page area in pixels.
Width Width (length) of the area in pixels.
Height Height of the area in pixels.
includePartial

True: Complete words that appear partially in the specified area with outside information.

False: Restrict reading of worktext to specified area.

Example

The word "Invoice" exists on the page, but our page area only captures "Inv". Setting includePartial to False returns only "Inv", setting includePartial to True returns the entire word "Invoice".

Sample Code

The following sample code takes the OCR results of the top left page area and places the result into the first row table cell.

Dim ptrWorkText as SCBCroWorktext
Set ptrWorkText = New SCBCroWorktext
Set ptrWorkText = pWorkdoc.GetWorktextForPageArea(0, 100, 100, 300, 300,True)
pWorkdoc.Fields.ItemByName("TableField").Table(0).CellWorktext(0,0) = ptrWorkText