LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)
LEAD Technologies, Inc

SetRecognizedCharacters Method






The modified page characters to set.
Sets the recognized character data of this IOcrPage .NET support WinRT support
Syntax
void SetRecognizedCharacters( 
   IOcrPageCharacters pageCharacters
)
'Declaration
 
Sub SetRecognizedCharacters( _
   ByVal pageCharacters As IOcrPageCharacters _
) 
'Usage
 
Dim instance As IOcrPage
Dim pageCharacters As IOcrPageCharacters
 
instance.SetRecognizedCharacters(pageCharacters)
void SetRecognizedCharacters( 
   IOcrPageCharacters pageCharacters
)
function Leadtools.Forms.Ocr.IOcrPage.SetRecognizedCharacters( 
   pageCharacters 
)
void SetRecognizedCharacters( 
   IOcrPageCharacters^ pageCharacters
) 

Parameters

pageCharacters
The modified page characters to set.
Remarks

Use this method to set the recognized characters of a page after you modify them. To get the recognized characters of a page use GetRecognizedCharacters.

You must call this method after the IOcrPage has been recognized with the Recognize or RecognizeText method. i.e., if the value of the IsRecognized property of this page is false, then calling this method will throw an exception.

You can use the GetRecognizedCharacters to examine the recognized character data. This data contain information about the character codes, their confidence, guess codes, location and position in the page as well as font information. For more information, refer to OcrCharacter.

The GetRecognizedCharacters method returns an instance of IOcrPageCharacters, this instance is a collection of IOcrZoneCharacters objects. Each of the IOcrZoneCharacters objects will contain the collection of the OcrCharacter that forms a zone in the page. The IOcrZoneCharacters.ZoneIndex property contains the zero-based index of the zone. You can get the zone information by using the same index with the getter of the Zones property of this IOcrPage.

Use IOcrZoneCharacters.GetWords to get the recognized words of a zone.

Notes on spaces: The LEADTOOLS Plus and Advantage OCR engines will not return any space characters when using the GetRecognizedCharacters method.

The LEADTOOLS Professional OCR engine will not return space characters if the value of the boolean Recognition.SpaceIsValidCharacter setting value is false (the default). If you absolutely require space characters in the recognition results when using the LEADTOOLS Professional Engine, then set the value of the boolean Recognition.SpaceIsValidCharacter setting to true ( ocrEngineInstance.SettingManager.SetBooleanValue("Recognition.SpaceIsValidCharacter", true)). For more information on OCR settings, refer to IOcrSettingManager and LEADTOOLS OCR Professional Engine Settings.

The SetRecognizedCharacters method will accept space characters in the LEADTOOLS Plus and Advantage engines. However, these space characters will be used when generating the final document (PDF) and might affect the final output. Therefore, it is not recommended that you insert space characters when using the LEADTOOLS Plus and Advantage engines.

The LEADTOOLS Professional OCR engine will strip any space characters from the results passed to SetRecognizedCharacters if the value of the boolean Recognition.SpaceIsValidCharacter setting value is false (the default). If you absolutely require space characters in the recognition results when using the LEADTOOLS Professional Engine, then set the value of the boolean Recognition.SpaceIsValidCharacter setting to true before calling SetRecognizedCharacters.

If you use the GetRecognizedCharacters and SetRecognizedCharacters methods to modify the recognition result prior to saving to an output file, and you are planning on using the engine native save capability (through setting the IOcrDocumentManager.EngineFormat property and using DocumentFormat.User in the IOcrDocument.Save method), then you must change the boolean Recognition.SpaceIsValidCharacter setting to true.

The IOcrPageCharacters interface also contains the IOcrPageCharacters.UpdateWord method that allow to modify the OCR recognition results by updating or deleting the words before optionally saving the results to the final output document.

Example
For an example, refer to GetRecognizedCharacters
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IOcrPage Interface
IOcrPage Members
GetRecognizedCharacters Method
OcrCharacter Structure
IOcrPageCharacters Interface
IOcrZoneCharacters Interface
IOcrPageCollection Interface
IOcrZoneCollection Interface
OcrZone Structure
AutoZone
Programming with the LEADTOOLS .NET OCR

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

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