Introduction

The LEADTOOLS OCR COM object provides numerous properties, methods and events to let you:

Add page(s) to the internal OCR list of pages.

Select the language to use in recognizing the OCR pages.

Recognize a variety of documents, including facsimiles, photocopies and documents with complex layouts.

Save the document in any of several text output formats.

Output a markup language that contains a rich set of markups and is useful for applications that will process the data after recognition and to extract the information provided in the markups.

Use the OCR engine text verification system to view and interact with the recognition process to verify recognized text.

Correct certain document characteristics such as noise, darkness, lightness, etc. to get the best possible character recognition.

LEADTOOLS OCR includes the following COM Object developed by LEAD Technologies, Inc.:

ILEADRasterDocument provides controls for dealing with OCR functionality.

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The toolkit comes in 32-bit Document/Medical and non-Document/Medical editions. You can use LEADTOOLS OCR COM in any programming environment that supports COM Objects, including the following:

Visual C++ 5.0 and later (32-bit)

Visual Basic 5.0 and later (32-bit)

Delphi 4.0 and later

Visual FoxPro 6.0 and later

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.


Example Programs

Note:

You can run some of the example programs on your system by clicking the appropriate buttons in online help. An error message will appear if you try to run an example program that is not on your system.

The executable files for these examples were compiled with Document/Medical capabilities of the toolkit. To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical toolkit. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical capabilities.

Visual Basic

OCR VB Demo

EXAMPLES\COM\VB\OCR VB Demo contains a sample application that demonstrates most of the OCR capabilities in Visual Basic 5.0 for the ActiveX. To run the 32-bit sample application, you can run the EXE file in LEAD's BIN directory.

Visual C++

OCR MFC Demo

EXAMPLES\COM\MFC4\OCR MFC Demo contains a sample application that demonstrates most of the OCR capabilities in Visual C++ 4.0 for the ActiveX.


Version History

Current version: | 14.5
Last update: | October 20, 2005

Changes from Version 14 to Version 14.5

Version 14


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS OCR COM has not changed from Version 14.


Version 14

Version 14 is the first version of the LEADTOOLS OCR COM Object.

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The rest of this topic lists the new properties, methods and events by interface.

ILEADRasterDocument

ActiveLanguage property

ActiveLanguagesCount property

ActivePageIndex property

AddItemToUserDictionary method

AddPage method

AddZone method

AutoOrientPage method

DefaultPageFillMethod property

DefaultSpellLanguages property

DefaultSpellLanguagesCount property

DestinationClipHeight property

DestinationClipLeft property

DestinationClipTop property

DestinationClipWidth property

DestinationHeight property

DestinationLeft property

DestinationTop property

DestinationWidth property

DetectOrientationDegree property

DictionaryDefaultSection property

DictionaryFileName property

DictionaryItemAttribute property

DictionaryState property

DrawPage method

DrawPersistence property

EnableCorrection property

EnableFireRecognizeStatus property

EnableMethodErrors property

EnableParallelRecognition property

EnableProgressStatusEvent property

EnableSaveResultsToMemory property

EnableShowZones property

EnableStopRecognizeStatus property

EnableSubSystem property

EnableZoneForceSingleColumn property

EnumOutputFileFormats event

ExportPage method

ExportZones method

FileFormatInfo property

FindZones method

GetAutoZoneOptions method

GetFileFormatInfo method

GetHandPrintOptions method

GetHandPrintOptions method

GetOMROptions method

GetOMROptions method

GetOutputFileFormats method

GetRecognitionResultOptions method

GetRecognizedCharacters method

GetRecognizedWords method

GetStatus method

GetStatus method

GetUserDictionarySection method

GetUserDictionarySectionItem method

GetZoneInfo method

HandPrintModuleOptions property

ImportZones method

IsCharacterEnabled method

LanguageCharacterFilter property

LanguageCharacterPlus property

LanguageCharacterPlusFilter property

LoadSettingsFile method

MemoryRecognitionResult property

MemoryRecognitionResultSize property

MOREnableFax property

OMRModuleOptions property

PageBitsPerPixel property

PageCount property

PageFillMethod property

PageHeight property

PageWidth property

PaintZoomFactor property

ProgressStatus event

RecognitionDataFileName property

RecognitionStatus event

Recognize method

RecognizedCharacter property

RecognizedCharactersCount property

RecognizedWord property

RecognizedWordHeight property

RecognizedWordLeft property

RecognizedWordsCount property

RecognizedWordTop property

RecognizedWordWidth property

RecognizedWordZone property

RecognizeModuleTradeoff property

RemoveItemFromUserDictionary method

RemovePage method

RemoveSelectedZone method

RemoveZone method

ResultOptions property

SaveDocument method

SaveResultsToMemory method

SaveSettingsFile method

ScaleMode property

SelectedLanguages property

SelectedLanguagesCount property

SelectedZone property

SelectedZonePenColor property

SelectedZonePenStyle property

SelectedZonePenWidth property

SelectLanguages method

SelectZone method

SelectZoneByPoint method

SelectZoneIndex property

SetAutoZoneOptions method

SetHandPrintOptions method

SetOMROptions method

SetRecognitionResultOptions method

SetRecognizedCharacters method

SetSelectedZonePen method

SetUserDictionary method

SetZonePen method

ShowZoneGridLines property

ShutDown method

SourceClipHeight property

SourceClipLeft property

SourceClipTop property

SourceClipWidth property

SourceHeight property

SourceLeft property

SourceTop property

SourceWidth property

SpecialMissingSymbol property

SpecialRejectedCharacter property

SpellLanguageID property

StartUp method

StopProgressStatusEvent property

UpdatePage method

UpdateZone method

UpdateZoneArea method

ZoneCount property

ZoneHeight property

ZoneLeft property

ZoneParser property

ZonePenColor property

ZonePenStyle property

ZonePenWidth property

ZoneTop property

ZoneWidth property

ILTZoneData

Left property

Top property

Right property

Bottom property

ID property

FillMethod property

RecognizeModule property

CharacterFilter property

Type property

Flags property

SectionName property

EnableVerificationEvent property

StopVerificationEvent property

VerifyCode property

Verification event

ILTHandPrintOptions

Style property

EnableSpace property

CharacterHeight property

CharacterWidth property

CharacterSpace property

ILTOMROptions

EnableFill property

Frame property

Sense property

ILTRecognizeStatus

RecognizedCharacterCount property

RecognizedWordCount property

RejectCharacterCount property

RejectWordCount property

RecognizedTime property

ReadingTime property

PreProcessTime property

DecompositionTime property

ILTDocumentOptions

PaperSizeMode property

PaperType property

PaperOrientation property

LanguageMode property

ResultLanguage property

Color property

EnableTextInBoxes property

MarginsMode property

MarginLeft property

MarginTop property

MarginWidth property

MarginHeight property

EnablePageBreaks property

TableMethod property

ILTParagraphOptions

SpaceBeforeMode property

SpaceBefore property

ParagraphIndentMode property

FirstLineIndent property

LineSpacingMode property

LineSpacing property

AlignmentMode property

Alignment property

ILTCharacterOptions

SelOutputFont property

FontNames property

Size property

Bold property

Italic property

Underline property

ILTMarkOptions

ColorSuspectCharacter property

ColRejectionSymbol property

ColMissingSymbol property

ColSuspectWord property

SeparatorBeforeSuspectCharacter property

SeparatorBeforeRejectionSymbol property

SeparatorBeforeMissingSymbol property

SeparatorStartSuspectWord property

SeparatorEndSuspectWord property

SeparatorStartLine property

SeparatorEndLine property

SeparatorStartTableRow property

SeparatorEndTableRow property

SeparatorStartParagraph property

SeparatorEndParagraph property

SeparatorStartZone property

SeparatorEndZone property

SeparatorStartPage property

SeparatorEndPage property

ILTResultOptions

Format property

FormatLevel property

DocumentOptions property

ParagraphOptions property

CharacterOptions property

MarkOptions property

ILTFileFormatInfo

FormatName property

DLLName property

ExtName property

Type property

ILTRecognizedCharacters

Left property

Top property

Width property

Height property

YOffset property

Space property

SpaceErr property

GuessCode property

GuessCode2 property

GuessCode3 property

ZoneIndex property

CellIndex property

Confidence property

Font property

Flags property

FontSize property

LanguageId property

LanguageId2 property


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.
Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.
OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
Home page: http://www.leadtools.com


Programming with LEADTOOLS OCR Functions

Programming with LEADTOOLS OCR Methods and Properties

The LEADTOOLS OCR features provide methods for incorporating optical character recognition (OCR) technology into an application. OCR is used to process bitmap document images into text. The LEADTOOLS OCR features are based on and use the ScanSoft TextBridge® OCR Engine.

Once the LEADTOOLS OCR API toolkit is installed to the system, the user is ready to begin programming with LEADTOOLS OCR. Please note that the OCR features must be unlocked before the user can actually use the OCR properties, methods, and events. For more information on unlocking LEAD features, refer to Unlocking Special LEAD Features.

LEADTOOLS provides methods to:

recognize and export text, choosing from a variety of text, word processing, database, or spreadsheet file formats.

select the language of documents to be recognized. Choose from English, Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, or Swedish.

segment complex pages manually or automatically into text zones, image zones, table zones, lines, headers and footers.

set accuracy thresholds prior to recognition to control the accuracy of recognition.

learn, save, and load character recognition data for similar documents. The software learns as a result of normal recognition, and acquires additional information by using the OCR’s text verification system.

recognize text from 5 to 72 points in virtually any typeface.

increase recognition accuracy with built-in and user dictionaries.

automatically detect fax, dot matrix, and other degraded documents and compensate accordingly.

process both text and graphics. The recognition software's ability to distinguish halftone graphics from text can provide the basis of a compound document processing system.

save the document in any of 40 formats, including MS Word, MS Excel, Dbase, PDF and WordPerfect

LEADTOOLS uses an OCR handle to interact with the OCR engine and the internal OCR list of pages. The OCR handle is a communication session between LEADTOOLS OCR and an OCR engine installed on the system. This OCR handle is an internal structure that contains all the necessary information for recognition, getting and setting information, and text verification.

The following is an outline of the general steps involved in recognizing one or more pages.

Startup the OCR Engine with the StartUp method. For more information, refer to Starting and Shutting Down the Engine.

1. | Establish an internal OCR document with one or more pages. For more information, refer to Working with Pages.
2. | Establish zones on the page(s), either manually or automatically. (This is optional. A page can be recognized with or without zones.) For more information, refer to Working with Zones.
3. | Set the active languages to be used by the OCR engine. (Optional. The default is English.) For more information, refer to Working with Languages.
4. | Set the spell checking language. (Optional. The default is English.) For more information, refer to Working with Languages.
5. | Set any special recognition module options. This is required only if the page contains zones, created either automatically or manually. For more information, refer to Recognizing Document Pagesand An Overview of Recognition Modules.
6. | Provide code for the Verification Event, if it will be used. (Optional)
7. | Recognize. For more information, refer to Recognizing Document Pages.
8. | Save recognition results, if desired. The results can be saved to either a file or to memory. For more information, refer to Recognizing Document Pages.
9. | Shut down the OCR engine when finished. For more information, refer to Starting and Shutting Down the Engine.

where steps 3, 4, 5, 6, and 7 can pretty much be done in any order, as long as they are carried out after starting up the OCR engine and before recognizing a page.


Unlocking Special LEAD Features

LEAD offers a variety of features, such as Document support, Medical support, Vector support, etc., which are only available in certain toolkits and are locked. To use these features you must:

purchase a toolkit that supports the desired feature(s).

print the applicable runtime agreement from the help file. For information on the runtime agreements, go to Topic Selection and click on the LEAD Licensing button.

complete the Transmittal document and fax it and the runtime agreement to LEAD's Licensing Department at 704 – 372 – 3789. (To view the transmittal document you must have Adobe® Acrobat® installed.)

if prepaid licenses are desired, include the order form with payment information. You can fax this along with the Transmittal form and the runtime agreement. (To view the order form you must have Adobe® Acrobat® installed.)

once we have received the signed agreement, we will send instructions for eliminating the license dialogs and the key(s) necessary for unlocking the appropriate features.

when you have received the instructions and the key(s) call the UnlockSupport method with the appropriate key.

For example, if you have purchased the LEADTOOLS Document Imaging toolkit:

print the Document Imaging Agreement (or the Document Imaging with OCR Agreement if you have also purchased the LEADTOOLS OCR Module).

complete the Transmittal document and fax it and the Document Imaging Agreement (or the Document Imaging with OCR Agreement) to LEAD's Licensing Department.

if you want prepaid licenses, print a copy of the order form, fill it out and send the order form and payment information to LEAD.

once we have received the signed Document Imaging Agreement (or Document Imaging with OCR Agreement), we will send the instructions for eliminating the license dialogs and any necessary keys.

when you receive the instructions and the key(s), call UnlockSupport (L_SUPPORT_DOCUMENT, "Document Key") to unlock the Document features. Please note that "Document Key" represents the actual key you will receive from LEAD. Also note that if you also purchased the LEADTOOLS OCR Module, the OCR features will have to be unlocked separately, using the appropriate key.

For information on products and the features available in each product, or for information on licensing, refer to Topic Selection.

To determine if a certain feature is locked, call the IsSupportLocked method.


Starting and Shutting Down the Engine

To begin using the LEADTOOLS OCR document toolkit, the user must start and initialize the OCR engine by calling the StartUp method. The StartUp method initializes the engine using default values. Once the StartUp method has been called, the user may set the desired engine settings using properties and methods provided by LEADTOOLS. Some of these properties are listed below:

CharacterOptions property

DocumentOptions property

MarkOptions property

PageFillMethod property

ParagraphOptions property

The user may opt to load previously saved engine settings by calling the LoadSettingsFile method. This method loads engine settings that have been saved in a file in an earlier session using the SaveSettingsFile method.

While working with the OCR engine, the user can receive progress notification through the ProgressStatus event for all processes performed by the OCR engine. To generate these ProgressStatus events, the EnableProgressStatusEvent property must be set to TRUE. To stop the generation of these events, set the EnableProgressStatusEvent property to FALSE. In addition, the ProgressStatus event may also be stopped within the event itself by setting the StopProgressStatusEvent property to TRUE.

When the OCR engine is no longer needed, the user must stop the engine and free any associated memory used by the engine by calling the ShutDown method. Once the ShutDown method has been called, the user must again call the StartUp method before recognizing any more pages.


Working with Pages

After starting the OCR document engine, the user must populate the internal OCR document with one or more pages. To add one or more pages to the OCR document, call the AddPage method. To remove a page from the OCR document, call RemovePage.

It may be necessary to alter the orientation of a page to make it more readable. This is done by rotating the page until the top of the page is located properly. This can be done automatically by calling the AutoOrientPage method. This method corrects the rotation of the page and automatically updates the image data. The angle by which the page needs to be rotated can be obtained for a specific page by reading the DetectOrientationDegree property.

Several properties are maintained internally and updated with information about one or more pages in the OCR document. When either the AddPage method or the RemovePage method returns, the PageCount property is updated with the total number of pages in the OCR document. In addition, the height, width and bits per pixel are maintained internally for each page of the OCR document. This information can be obtained for each page through the PageHeight, PageWidth and PageBitsPerPixel properties.

If the bitmap of a page changes, for example following the application of an image processing method, the page should be updated by calling the UpdatePage method.

The ExportPage method exports a page from the OCR document to a raster object.

The pages of the OCR document can be recognized with or without zones on the pages. For more information on zones, refer to Working with Zones.


Drawing Pages and Zones

LEADTOOLS provides methods for drawing pages, with or without zones. The zones may or may not be selected.

Before drawing a page, that page must be set as "active" by setting the ActivePageIndex property. Once the active page has been set, call the DrawPage method to draw the active page. The value of the EnableShowZones property determines whether the zones will be drawn with the page. The DrawPage method will draw the page either on the raster object passed to it or on the HDC, based on the value of the DrawPersistence property.

A page may be drawn "zoomed in" by setting a paint zoom factor before actually drawing the page. To set the paint zoom factor for a specific page, set the PaintZoomFactor property for that page.

When using the DrawPage method, the height and width of both the source page and the destination page, as well as the areas that are actually painted can be controlled using the following properties:

DestinationClipHeight property

DestinationClipLeft property

DestinationClipTop property

DestinationClipWidth property

DestinationHeight property

DestinationLeft property

DestinationTop property

DestinationWidth property

SourceClipHeight property

SourceClipLeft property

SourceClipTop property

SourceClipWidth property

SourceHeight property

SourceLeft property

SourceTop property

SourceWidth property

The unit or measure for these "source" and "destination" properties is determined by the ScaleMode property.

A zone can be selected and drawn in the HDC using the SelectZone method or the SelectZoneByPoint method. The SelectZone selects or deselects a zone by specifying a page index and a zone index. If the zone is selected, the zone is drawn with a "selection rectangle" around it.

The SelectZoneByPoint selects a zone by determining which zone on the page contains the specified point. If a zone containing that point is found, that zone is selected and the zone is redrawn with a "selection rectangle" around it. The SelectedZone property and the SelectZoneIndex property are also updated with information on the zone located at the specified point.

To set the pen used to draw the zones, set the ZonePenColor property, the ZonePenStyle property, and the ZonePenWidth property to the desired values and call the SetZonePen method. To set the pen used to draw the selected zones, set the SelectedZonePenColor property, the SelectedZonePenStyle property, and the SelectedZonePenWidth property to the desired values and call the SetSelectedZonePen method.

To update the area of a specific zone on a specific page, call the UpdateZoneArea method.

The RemoveSelectedZone method removes the selected zone from the zone list of the specified page.


Working with Zones

Once the OCR document has been populated with pages, the user can create zones within the page(s) to be recognized. Zones are optional. A page does not have to have zones in order to be recognized. Zones can be added manually, or automatically. Once zones have been added to a page the zones can be manipulated and information about those zones can be obtained. For more information, refer to the following sections:

Adding Zones Manually

Zones may be added to a page manually using the AddZone method. This method takes parameters that indicate the index of the page on which to add the zones and the index of the zone to add. In addition, the method takes a pointer to an ILTZoneData object that contains information about the zone to add. To provide this information, declare a variable of type ILTZoneData. Set the properties of that object to the desired values and pass a pointer to the object to the AddZone method. For more information on the properties accessed through the ILTZoneData object, refer to Using the ILTZoneData Properties.

A list of zones, saved using the ExportZones method , may be imported to a specific page by calling the ImportZones method.

Adding Zones Automatically

Zones may be added to a specific page automatically using the FindZones method. Zones may be detected automatically over the entire page or within a specific area, depending on the bUseImageArea parameter. If this parameter is TRUE, then zones are detected for the entire page. If this parameter is FALSE, then the engine detects zones only in the area of the page defined by the ZoneLeft, ZoneTop, ZoneHeight and ZoneWidth properties.

Regardless of the area searched for zones, other automatic zoning options are used in detecting zones on a page. These options are accessed through the following properties:

EnableZoneForceSingleColumn property

ShowZoneGridLines property

ZoneParser property

These properties are updated with the current values when the GetAutoZoneOptions method is called. To set the automatic zoning options for the OCR engine, set these same properties and call the SetAutoZoneOptions method.

Getting Information Once Zones are Established

Once zones have been established, either manually or automatically, the user can get information about one or more of those zones. The GetZoneInfo method updates a pointer to an ILTZoneData object with information about a zone at a specific index on a specific page.

In addition to the information acquired by the GetZoneInfo method, the OCR engine maintains the ZoneCount property internally, automatically updating the value when a zone is added to or removed from a page using the AddZone method or the RemoveZone method.

If the host PC has two processors or a hyper-threaded one, using the Parallel Recognition Mode can speed up the recognition process by allowing the two recognition engines to run in parallel. The Parallel Recognition Mode may be used when a zone is associated with any of the following recognition modules: RECOGMODULE_MTEXT_OMNIFONT, RECOGMODULE_OMNIFONT_FRX, or RECOGMODULE_OMNIFONT_PLUS3W. To enable or disable the Parallel Recognition Mode, call set the EnableParallelRecognition property accordingly.

Manipulating Zones

Zones on a specific page can be removed using the RemoveZone method.

Update a zone on a specific pages with new ILTZoneData information using the UpdateZone method.

Zones on a page may be filled using any of a number of filling methods. The PageFillMethod property contains the fill method used by the OCR engine to fill zones of all pages processed by the engine, until the fill method is changed. The DefaultPageFillMethod property contains the default fill method for a specific page.

When scrolling a page that contains zones, the zones must also be scrolled in order to display the zones at the proper location on the page. The OffsetZones method takes the amount the page was scrolled and scrolls the zones accordingly.


Using the ILTZoneData Properties

The ILTZoneData object contains information used to set a zone on a page, or is updated with information about an existing zone.

The boundaries of the zone are contained in the Left, Right, Top and Bottom properties.

Each zone has an identifier, which can be found in the ID property.

For each word recognized by the OCR engine, a Verification event is generated if the EnableVerificationEvent property has been set to TRUE. The EnableVerificationEvent property indicates whether the event will be generated. To stop the current Verification event, set the StopVerificationEvent property to TRUE within the Verification event. The value of the VerifyCode property should be set within the Verification event to determine whether a recognized word is acceptable. If the word is accepted, the engine proceeds to the next recognized word. If the recognized word is not accepted, the engine offers possible suggestions for the recognized word.

Several other properties contain information about a zone, including the section of the user dictionary associated with the zone (SectionName property), the filling method used for the zone (FillMethod property) and the type of zone (Type property). The Flags property indicates which dictionaries and checking procedures are used during the recognition process. The CharacterFilter property indicates which character set filter is associated with the zone.

Finally, the RecognizeModule property indicates which recognition module is associated with a zone. Depending on the recognition module associated with a zone, other recognition options may be available to the Engine to aid in the recognition process.

If the RecognizeModule property is: | The following options are available:
RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL | The HandPrint Options are available. For more information, refer to Using the Hand Print Options.
RECOGNIZE_MODULE_OMR | The OMR Options are available. For more information, refer to Using the OMR Options.
RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT | The MOREnableFax property is used.

Depending on the type of recognition module associated with a zone, it may be beneficial to trade-off between the accuracy of recognition and the speed of recognition. The RecognizeModuleTradeoff property gets or sets a value that tells the OCR engine to perform the most accurate recognition, the fastest recognition, or a balanced recognition.

For some general information about available recognition modules, refer to An Overview of Recognition Modules.


Using the HandPrint Options

If the RecognizeModule property (ILTZoneData) of a specific zone is RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL, then the Hand Printed Numerical Recognition Module is associated with the zone and several other hand print options can be used to aid in recognition of the zone.

To get the current hand print options, call the GetHandPrintOptions method. This method updates the HandPrintModuleOptions property with the current values. The HandPrintModuleOptions property itself is read only, but the ILTHandPrintOptions properties accessed through this property can be set. Set these properties to the desired new values and set the Hand Print options for the OCR engine by calling the SetHandPrintOptions method.

Since the hand print options pertain to characteristics of hand printed numerals, the properties represent various characteristics of hand written numbers. The style of the numbers can be found in the Style property. The height and width of the characters can be found in the CharacterHeight and CharacterWidth properties respectively. The CharacterSpace property indicates how much space is present before each character. If the EnableSpace property is set to TRUE, then this space will be output to the recognition results.


Using the OMR Options

If the RecognizeModule property (ILTZoneData) of a specific zone is RECOGNIZE_MODULE_OMR, then the Optical Mark Recognition Module is associated with the zone and several other OMR options can be used to aid in recognition of the zone.

To get the current OMR options, call the GetOMROptions method. This method updates the OMRModuleOptions property with the current values. The OMRModuleOptions property itself is read only, but the ILTOMROptions properties accessed through this property can be set. Set these properties to the desired new values and set the OMR options for the OCR engine by calling the SetOMROptions method.

Since the OMR options pertain to characteristics of optical marks, the properties represent various characteristics of optical marks. The Frame property indicates whether the OMR zone borders will be visible and the Sense property indicates the sensitivity of the mark. The EnableFill property indicates the possible values for each OMR zone output in the recognition results.


Working with Languages

The OCR engine supports many different languages for recognizing text. For a language to be used in the recognition process it must be set as active. To activate the languages that will be used in the next recognition process, set the number of languages to be activated in the ActiveLanguagesCount property, set the languages to be activated in the ActiveLanguage property and call the SelectLanguages method. This method updates the SelectedLanguages property with the languages that were activated. The SelectedLanguagesCount property is updated by the engine with the number of languages in the SelectedLanguages property.

Special characters can be added to the set of characters provided by the active languages using the LanguageCharacterPlus, LanguageCharacterPlusFilter, and LanguageCharacterFilter properties. To determine whether a specific character is enabled in the active languages, call the IsCharacterEnabled method.

The DefaultSpellLanguagesCount property is updated with the number of default languages used to checking spelling. The DefaultSpellLanguages property actually contains the list of default languages used to check spelling.


Language Dictionary List

The OCR engine supports a number of languages for checking the spelling. These languages are listed below, along with their associated dictionary file. The language to use should be specified in the SpellLanguageId property before calling the Recognize method. For more information on options for the recognition process, refer to ILEADRasterDocument.

SPELLING LANGUAGE | LANGUAGE DICTIONARY FILE
Catalan | R_CAT.DAT
Czech | R_CZH.DAT
Danish | R_DAN.DAT
Dutch | R_DUT.DAT
English | R_ENG.DAT
Finnish | R_FIN.DAT
French | R_FRE.DAT
German | R_GER.DAT
Greek | R_GRE.DAT
Hungarian | R_HUN.DAT*
Italian | R_ITA.DAT
Norwegian | R_NOR.DAT
Polish | R_POL.DAT*
Portuguese | R_POR.DAT
Russian | R_RUS.DAT
Slovenian | R_SLN.DMD
Spanish | R_SPA.DAT
Swedish | R_SWE.DAT

* Also requires the file ICHUNW32.DLL.


Working with a Dictionary

One of the responsibilities of the checking subsystem is to check the user dictionary for acceptable words during recognition, provided a user dictionary has been set. To use a user dictionary during recognition, one must be created or opened using the SetUserDictionary method before calling the Recognize method. The DictionaryDefaultSection property contains the name of the user dictionary and the default section of the user dictionary.

Creating a New User Dictionary

To create a new user dictionary, set the call the SetUserDictionary method with the bCreateUD parameter set to TRUE. This will create the dictionary in memory. Add items to the dictionary using the AddItemToUserDictionary method. Once all the desired changes/additions have been made to the new dictionary, do the following:

set the DictionaryFileName property to the proper name

set the DictionaryDefaultSection property to the desired default section

set the DictionaryItemAttribute property to indicate how to add the items to the dictionary

call the SetUserDictionary with the bCreateUD parameter to FALSE to save the dictionary to the file.

Loading an Existing User Dictionary

To load an existing user dictionary that has been saved to a file, set the DictionaryFileName property to that name of the file containing the user dictionary and call the SetUserDictionary method with the bCreateUD parameter set to FALSE.

While the user dictionary is being used, it may have material added or removed. Items may be added using the AddItemToUserDictionary method or removed using the RemoveItemFromUserDictionary method. The DictionaryState indicates whether the user dictionary has been changed while it has been open.

Getting Information from the User Dictionary

A user dictionary consists of one or more sections (folders or categories) and each section can have one or more items (folder contents). When the user dictionary is opened or created, the user dictionary is opened to a specific default section. The default section for a user dictionary is set in the DictionaryDefaultSection property. If the user dictionary is saved to a file, the default section set in the DictionaryDefaultSection property is stored with the dictionary so that if that file is later opened, the dictionary will be opened to that section. When an existing user dictionary is opened, the DictionaryDefaultSection property is updated with the name of the default section. The default section is automatically the first section in the dictionary. To get the name of a section in a dictionary, use the GetUserDictionarySection method. This method returns either the first section of a dictionary, or the next section in the dictionary, depending on the bFirst parameter. Items of each section can be obtained by calling the GetUserDictionarySectionItem method. This method returns either the first item of a section, or the next item in a section, depending on the bFirst parameter.


Recognizing Document Pages

Before Recognition

Before recognizing the pages of an OCR document, several steps must be taken. These are outlined below:

Start and initialize the OCR engine: For more detailed information on this refer to Starting and Shutting Down the Engine.

Populate the internal OCR document with pages: For more information on adding pages, refer to Working with Pages.

Apply zones to pages if needed: For more detailed information on adding zones to a page and the options available based on the recognition module associated with a zone, refer to Working with Zones, Using the ILTZoneData Properties, Using the HandPrint Options and Using the OMR Options.

Depending on the type of recognition module associated with a zone, it may be beneficial to trade-off between the accuracy of recognition and the speed of recognition. The RecognizeModuleTradeoff property gets or sets a value that tells the OCR engine to perform the most accurate recognition, the fastest recognition, or a balanced recognition.

If the host PC has two processors or a hyper-threaded one, using the Parallel Recognition Mode can speed up the recognition process by allowing the two recognition engines to run in parallel. The Parallel Recognition Mode may be used when a zone is associated with any of the following recognition modules: RECOGMODULE_MTEXT_OMNIFONT, RECOGMODULE_OMNIFONT_FRX, or RECOGMODULE_OMNIFONT_PLUS3W. To enable or disable the Parallel Recognition Mode, set the EnableParallelRecognition property accordingly.

Set the desired engine settings: Before recognizing pages, the user can set some general engine settings to suit the type of document to be recognized. This includes language information, checking subsystem information, etc. The checking subsystem is responsible for checking spelling, checking the user dictionary for acceptable words during recognition, provided a user dictionary has been set, and using the Verification event. Many of the settings that control this subsystem must be set before recognition. To enable the use of the subsystem, set the EnableSubSystem property to TRUE. To enable the correction mode of the subsystem, set the EnableCorrection to TRUE.

The SpellLanguageID property indicates the language the subsystem uses to check spelling. For further information on languages in general, refer to Working with Languages. For more information on preparing a user dictionary, refer to Working with a Dictionary.

To have LEADTOOLS OCR generate system error events, in addition to error return codes, set the EnableMethodErrors property to TRUE.

Recognizing a Document

Call the Recognize method: When all necessary recognition options have been set, the page(s) can be recognized by calling the Recognize method.

Generate the RecognitionStatus event: The RecognitionStatus event is generated during the recognition process to provide the user with information about any errors that occur. To enable the generation of the RecognitionStatus event, set the EnableFireRecognizeStatus property to TRUE. To stop the current RecognitionStatus event, set the EnableStopRecognizeStatus property to TRUE within the RecognitionStatus event. The generation of the RecognitionStatus event can also be disabled outside the RecognitionStatus event by setting the EnableFireRecognizeStatus property to FALSE.

Generate ProgressStatus events: The ProgressStatus event is generated during the recognition process to provide the user with information about the progress of a specific operation, the number of accepted characters seen so far, the number of rejected characters seen so far, and other aspects of the recognition process. To enable the generation of this event, set the EnableProgressStatusEvent property to TRUE. To stop the current ProgressStatus event, set the StopProgressStatusEvent property value to TRUE. The generation of the ProgressStatus event can also be disabled outside the ProgressStatus event by setting the EnableProgressStatusEvent property to FALSE

After Recognition

Get the status of the last recognition process: Accuracy and timing data for the last recognition process can be obtained using the GetStatus method. For more information, refer to Getting Status Updates.

Save the recognition results: The recognition results can be saved to a file or saved to memory. For more detailed information on saving recognition results and the material to export, refer to Handling the Results of the Recognition Process.

Get recognized character sets: Once a page has been recognized, the set of recognized characters for that page can be obtained by calling the GetRecognizedCharacters method. This updates the RecognizedCharacter property with the set of recognized characters for that page. This property is a pointer to an array of ILTRecognizedCharacters objects, where each object represents one of the recognized characters. While the RecognizedCharacter property is read only, the ILTRecognizedCharacters properties accessed through it can be set. . For more information on the ILTRecognizedCharacters properties accessed through the RecognizedCharacters property, refer to Using Recognized Characters.

Get special characters or symbols: During recognition, special characters or symbols are used to denote missing characters or rejected characters. These characters or symbols, used in the recognition process can be found in the SpecialMissingSymbol property and the SpecialRejectedCharacter property.


Using Recognized Characters

Following recognition, the set of recognized characters for a specific page can be obtained by calling the GetRecognizedCharacters method. This method updates the RecognizedCharactersCount property with the number of characters that have been recognized, and updates the RecognizedCharacter property with the set of recognized characters for the specified page. This property is a pointer to an array of ILTRecognizedCharacters objects, where each object represents one of the recognized characters. While the RecognizedCharacter property is read only, the ILTRecognizedCharacters properties accessed through it can be set. To set new recognized character information, set the ILTRecognizedCharacters properties, (for example RasterDoc.RecognizedCharacter(i).FontSize = 20) and then set the new information by calling the SetRecognizedCharacters method.

Various types of character information can be obtained or set using the ILTRecognizedCharacters properties. The Left and Top properties indicate the location of the recognized character, while the Height and Width properties give the character's dimensions. The YOffset property contains the distance along the Y axis from the baseline to the top of the character's bounding rectangle.

The font and the font size used for the recognized character are given in the Font property and the FontSize property, respectively. The Flags property contains further information on the formatting attributes of the recognized character.

The zone in which the recognized character is located is given in the ZoneIndex property. However, if the zone is a TABLE, the cell in which the recognized character is located is given in the CellIndex property.

The OCR engine may provide several "guesses" as to the identification of a recognized character. The GuessCode property contains the first "guess" for a character being recognized. If the engine rejects the character, however, this property will contain a 0. If the value of the GuessCode is not 0, the GuessCode2 and GuessCode3 properties contain the second and third guesses for the identification of the recognized character, respectively. The Confidence property contains a value that represents the certainty of the first guess.

A recognized character may be found in more than one language. The LanguageId property contains the first language in which the recognized character was found. The LanguageId2 property contains the second language in which the recognized character was found.

The Space property contains the number of spaces in front of the recognized character and the SpaceErr property contains a value indicating the certainty or reliability of the value in the Space property.


Working with Recognized Words

Once the characters on a page have been recognized, those characters can be combined into recognized words by calling the GetRecognizedWords method. To change the contents of the recognized words, change the set of recognized characters by calling the SetRecognizedCharacters method. To save the updated recognized characters to a file, call the SaveDocument method. To save the results into memory, call the SaveResultsToMemory method.

The GetRecognizedWords method updates the following properties:

RecognizedWord property

RecognizedWordsCount property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordHeight property

RecognizedWordWidth property

The RecognizedWordsCount property is updated with the number of words recognized on the page specified in the iPageIndex parameter of the GetRecognizedWords method. This is also the number of words updated in the RecognizedWord property. The value in the RecognizedWordsCount property also determines the valid index values for the RecognizedWordXXX properties.

Since the index for each of the RecognizedWordXXX properties is zero-based, possible values for the index parameters are from 0 to RecognizedWordsCount property– 1. The information in each RecognizedWordXXX property, at the same index, pertains to the word at that index in the RecognizedWord property. For example, if the RecognizedWordsCount property is updated with 4, there are four words in the RecognizedWord property. Valid values for the index parameter of each of the RecognizedWordXXX properties are from 0 – 3. For the word at RecognizedWords(0), the zone in which that word was found in RecognizedWordZone(0). The location, height and width of the word can be found in the RecognizedWordLeft(0), RecognizedWordTop(0), RecognizedWordHeight(0) and RecognizedWordWidth(0) properties.


An Overview of Recognition Modules

Automatic recognition module

Specifies that the Engine will try to automatically select the most suitable recognition module for the zone. This is determined just before recognition, according to the zone's filling method and, if necessary, other settings, most typically the Character Set.

MTX omnifont recognition module

This recognition module recognizes machine printed text; i.e. from printed publications, laser or ink-jet printers and electric typewriters. Output from mechanical typewriters in good condition may also be acceptable. It should also be used for Letter or Near Letter Quality output from dot-matrix printers, and can also be used for Draft Quality.Only images with the following resolution ranges are supported: 90-110, 160-240, 280-320, 400, 600.This module does not process images larger than 6600 pixels in either width or height, that is it can safely handle A3 size (11.69" x 16.54") both portrait and landscape images with 300 dpi resolution. At larger resolution the supported image size is smaller.

The maximum number of zones defined on an image that this module can handle is 64.

MOR multi-lingual omnifont recognition module

This module recognizes machine printed text; i.e. from printed publications, laser or ink-jet printers and electric typewriters. Output from mechanical typewriters in good condition may also be acceptable. It should also be used for Letter or Near Letter Quality (NLQ, LQ) output from dot-matrix printers. There are two ways of modifying incoming images to make them more suitable for this omnifont recognition module:

Standard mode Fax output. (200 x 100 dpi). This switch doubles the pixels in the image’s vertical direction. Faxes sent in Fine Mode (200 x 200 dpi) are preferable. However, if faxes are sent in Fine Mode, then the Standard mode Fax Output should not be used.

Draft 24-pin dot-matrix output. Use the FILL_DRAFTDOT24 filling method to have the character contours smoothed. Again, NLQ or LQ quality output can usually be better recognized without using FILL_DRAFTDOT24.

This module can safely handle A3 size (11.69" x 16.54") both portrait and landscape images with 300 dpi resolution.

The maximum number of zones defined on an image that this module can handle is 500.

DOT Matrix (DOT 9-pin draft dot-matrix recognition module)

This module is designed for ONLY draft-quality 9-pin dot-matrix texts. For NLQ or LQ texts, the RECOGMODULE_OMNIFONT_PLUS2W, RECOGMODULE_OMNIFONT_PLUS3W, RECOGMODULE_MTEXT_OMNIFONT or RECOGMODULE_MULTI_LINGUAL_OMNIFONT modules are likely to give better results.

OMR optical mark recognition module

This recognition module is used for recognizing optical marks (checkmarks). Typical application areas are in questionnaires, ballot papers, educational tests and reporting or ordering sheets, where the documents to be processed are form-like and filled by respondents, usually by hand.

HNR hand-printed numeral recognition module

This recognition module can be used for recognition of hand-printed numerals and four additional signs. If further hand-printed characters are to be recognized, the use of the RECOGMODULE_RER_PRINTED recognition module is recommended.

RER hand-printed recognition module

This is a third-party recognition module from reRecognition GmbH, Germany. The Engine contains its recognition engine version 4.0a.

MAT matrix matching recognition module

This module is designed to read certain groups of fixed-font characters specially designed for OCR or imaging applications, in which no two characters have similar shapes. Each character group has its own filling method. Application areas are in banking, check or waybill handling, product distribution and document validation, where high accuracy can be vital. It also handles some non-fixed print styles.

FRX multi-lingual omnifont recognition module

This module recognizes machine printed text; i.e. from printed publications, laser or ink-jet printers and electric typewriters. Output from mechanical typewriters in good condition may also be acceptable. It should also be used for Letter or Near Letter Quality (NLQ, LQ) output from dot-matrix printers.

PLUS2W and PLUS3W omnifont recognition modules

This recognition module recognizes machine printed text; i.e. from printed publications, laser or ink-jet printers and electric typewriters. Output from mechanical typewriters in good condition may also be acceptable.

The PLUS2W and PLUS3W modules use voting technology to provide improved recognition results.

The PLUS2W module combines the results from the MOR and MTX modules.

The PLUS3W module combines the results from the MOR, MTX and FRX modules.

With any of these two voting modules, the accuracy is considerably better, but the recognition may need significantly more time than any single module.

Asian recognition module

Recognizes the Asian languages.


Getting Status Updates

After the Recognize method is called and the recognition process has begun, the user can call the GetStatus method to get information about the accuracy and timing data of the last recognition process. The GetStatus method updates the RecognizeStatus property with the current recognition information.

The RecognizeStatus property is a read only property that is updated with a pointer to an ILTRecognizeStatus object that contains information on the most recent recognition process. This information includes various character and word counts, as well as various times required for processing and recognizing the document.

The number of recognized characters and words are given in the RecognizedCharacterCount property and the RecognizedWordCount property. The number of rejected characters and words are provided in the RejectCharacterCount property and the RejectWordCount property.

Information on the amount of time required for various aspects of the entire recognition process are also provided. The amount of time spent in pre-processing is given in the PreProcessTime property. The amount of time spent on the page layout is provided in the DecompositionTime property. The RecognizedTime property contains the amount of time spent in pure recognition, while the ReadingTime property contains the amount of time spent from the start of recognition until the recognition results were written.


Confidence reporting

For some applications, it may be important to know the reliability of the recognized text generated by the engine. These applications may require having additional confidence information for the recognized characters and/or words.

The engine can provide confidence information for the correctness of the recognized text in two different ways:

The engine's output-marking feature enables the SaveResultsToMemory method to place a user-defined character sequence into the final output document before suspiciously recognized characters and/or words. Alternatively, the suspicious characters and/or words can be set to a particular color in the output document to indicate recognition results with low confidence.

In another approach, the engine can generate output, which consists of structured data for each recognized character. In this output there is one structure or record for each character. The character code of the recognized entity is the primary field. Other fields include the coordinates of the character on the image, the zone to which the character belongs to, the font information for the character, and the confidence information.

The output-marking feature is supported by most of the output converters. Marking low confidence recognition with color requires the selection of an output format (e.g. MS Word) that supports colored text.

For more information on these converters, see the Output converter formatting properties topic.

A possible output for the marking feature might be as follows:

"We would like to ask you some questions, ta*king around 15 minutes"

The text extract above was generated using the output-marking feature, in which the asterisk ('*') character was set to mark the suspiciously recognized characters in the output.

Structured recognized output can be produced though one of the two special output converters (e.g. "2G Type 3"). Even more information can be retrieved directly into application memory by a call to the GetRecognizedCharacters method, just after calling the Recognize method. The GetRecognizedCharacters call provides the most detailed information about the recognized data. It results in a 36-byte long ILTRecognizedCharacters object for each recognized character. Whereas the 2G Type output formats provide 2nd guesses for each character, the ILTRecognizedCharacters object provides three.

There are two ILTRecognizedCharacters properties, which provide character recognition confidence information: the Confidence property and the SpaceErr property.

The Confidence property is a combined value. Its most significant bit is used to express the certainty/uncertainty of the word. (The word is uncertain, if this bit is set to 1). The remaining bits express the certainty of the recognition of the character, which ranges between 0 and 100. A value of zero (0) means that the engine recognized the character with high confidence. In some cases a word may have some or all characters that are individually suspicious but the characters are not be marked suspicious in the word bit. This is usually a result of language or user dictionary checking. It means the word was validated by the checking subsystem.

The SpaceErr property ranges between 0 and 100, and it expresses the confidence of the value in the space field of the structure, i.e. whether the Engine is certain regarding the space estimation in front of the recognized character.

Applications that examine the character confidence information can use a threshold value, above which the character value is treated as a suspicious result. A value of 64 is recommended for this purpose. A value less than 64 will indicate that the character was recognized with high confidence. A value of 64 or greater marks that code is suspicious.

Note:

This value (64) is also used internally in the same manner when the output-marking feature for suspicious characters in the output text is enabled.

IMPORTANT NOTE

The confidence reporting system works best when all three recognition modules are used in the voting scheme (RECOGNIZE_MODULE_OMNIFONT_PLUS3W). If other machine print recognition modules are used (RECOGNIZE_MODULE_OMNIFONT_PLUS2W, RECOGNIZE_MODULE_MTEXT_OMNIFONT, etc) then confidence information is still available, but the ability of the system to properly report confidence will be reduced. This will result in a higher level of false negative and false positive reporting of suspicious recognition results.


Handling the Results of the Recognition Process

Once the OCR document has been recognized, the results can be saved either to a file or to memory. To save the results to a file, call the SaveDocument with the desired file name specified in the bstrFileName parameter. The Recognize method saves the recognition results to the file specified in the RecognitionDataFileName property. When the SaveDocument method is called, the recognition results are read from the file specified in the RecognitionDataFileName property and converted to the final output file specified in the bstrFileName parameter of the SaveDocument method.

To save the recognition results to memory instead of a file, set the EnableSaveResultsToMemory property to TRUE and call the SaveResultsToMemory method. The SaveResultsToMemory method updates the MemoryRecognitionResult property with the actual recognition results and updates the MemoryRecognitionResultSize property with the size of the recognition results saved.

Recognition results options determine how the recognition results are saved, and exactly what is output. To get the current options used by the OCR engine to save the recognition results, call the GetRecognitionResultOptions method. This method updates the ResultOptions property with the current settings. The ResultOptions property itself is read only, but the ILTResultOptions properties accessed through this property can be set. Set these properties to the desired new values and set the recognition result options for the OCR engine by calling the SetRecognitionResultOptions method.

The recognition results are saved to an output document, which can be saved to a file or to memory. The output document will have a certain format type, as determined by the Format property. The amount of formatting saved to the output document is determined by the FormatLevel property. The other properties accessed through this ILTResultOptions object contain information on the document characteristics that are exported to the output document, paragraph characteristics that are exported to the output document, character characteristics that are exported to the output document, and mark characteristics that are exported to the output document.

The DocumentOptions property contains the document characteristics that are output to the output document. This property is a pointer to an ILTDocumentOptions object. While the DocumentOptions property is read only, the ILTDocumentOptions properties accessed through it can be set. For more information on the ILTDocumentOptions properties accessed through the DocumentOptions property of the ResultOptions property, refer to Using the Document Options.

The ParagraphOptions property contains the paragraph characteristics that are output to the output document. This property is a pointer to an ILTParagraphOptions object. While the ParagraphOptions property is read only, the ILTParagraphOptions properties accessed through it can be set. For more information on the ILTParagraphOptions properties accessed through the ParagraphOptions property of the ResultOptions property, refer to Using the Paragraph Options.

The CharacterOptions property contains the character characteristics that are output to the output document. This property is a pointer to an ILTCharacterOptions object. While the CharacterOptions property is read only, the ILTCharacterOptions properties accessed through it can be set. For more information on the ILTCharacterOptions properties accessed through the CharacterOptions property of the ResultOptions property, refer to Using the Character Options.

The MarkOptions property contains the mark characteristics that are output to the output document. This property is a pointer to an ILTMarkOptions object. While the MarkOptions property is read only, the ILTMarkOptions properties accessed through it can be set. For more information on the ILTMarkOptions properties accessed through the MarkOptions property of the ResultOptions property, refer to Using the Mark Options.

When saving recognition results to a file, you can use the GetOutputFileFormats method to enumerate all available output file formats supported by the OCR engine. For each file format enumerated, an EnumOutputFileFormats event is generated. Within this event, call the GetFileFormatInfo method to update the FileFormatInfo property with information on that file format.

The FileFormatInfo property is a pointer to an ILTFileFormatInfo object that accesses properties that are updated with the file format information. This information includes the name of the output text format (FormatName property), the default extension for the document (ExtName property), the type of document to output (Type property) and the name of the converter DLL (DLLName property). These ILTFileFormatInfo properties are read only, so they can only be used to get information about a file format. They cannot be used to change the file format information.


Using the Document Options

The recognition result options, which include document options, indicate how the recognition results are saved, and exactly what is output. To get the current options used by the OCR engine to save the recognition results, call the GetRecognitionResultOptions method. This method updates the ResultOptions property, which accesses the DocumentOptions property, with the current settings. This property is a pointer to an ILTDocumentOptions object. While the DocumentOptions property is read only, the ILTDocumentOptions properties accessed through it can be set. To set new document options, set the ILTDocumentOptions properties, accessed through the DocumentOptions property of the ResultOptions property (for example RasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4) and then set the new options for the OCR engine by calling the SetRecognitionResultOptions method.

Various document characteristics of the OCR document may be exported to the output document following recognition. The PaperSizeMode property indicates whether the paper size will be exported, and whether the exported size is predefined or calculated. Depending on the value of the PaperSizeMode property, the value of the PaperType property, which indicates the type of paper used for the document, may be exported to the output document. Similarly, depending on the value of the PaperSizeMode, the PaperOrientation property value may be exported to indicate the orientation of the output document.

The LanguageMode property indicates whether the resulting language is exported to the output document. Depending on the value of this property, the ResultLanguage property may contain the resulting language to be exported to the output document.

The MarginsMode property indicates whether the margins of the OCR document will be exported to the output document, and if so, whether those margin values are predefined or calculated. Depending on the value of the MarginsMode property, the MarginLeft property, MarginTop property, MarginWidth property and MarginHeight property properties may contain the margin settings.

The EnablePageBreaks property indicates whether page breaks will be exported to the output document.

The Color property, the EnableTextInBoxes property and the TableMethod property all indicate how some aspect of the document will be exported. The Color property indicates how the graphics will be exported. The EnableTextInBoxes property indicates whether zones will be kept in frames in the output document. The TableMethod property indicates how tables will be exported to the output document.


Using the Paragraph Options

The recognition result options, which include paragraph options, indicate how the recognition results are saved, and exactly what is output. To get the current options used by the OCR engine to save the recognition results, call the GetRecognitionResultOptions method. This method updates the ResultOptions property, which accesses the ParagraphOptions property, with the current settings. This property is a pointer to an ILTParagraphOptions object. While the ParagraphOptions property is read only, the ILTParagraphOptions properties accessed through it can be set. To set new paragraph options, set the ILTParagraphOptions properties, accessed through the ParagraphOptions property of the ResultOptions property (for example RasterDoc.ResultOptions.ParagraphOptions.SpaceBeforeMode = SELPREDEFINED) and then set the new options for the OCR engine by calling the SetRecognitionResultOptions method.

Various paragraph characteristics of the OCR document may be exported to the output document following recognition. The SpaceBeforeMode property indicates whether the space before a paragraph is exported to the output document, and if so, whether the value is predefined or calculated. Depending on the value of this property, the SpaceBefore property may contain the number of spaces before the paragraph.

The ParagraphIndentMode property indicates whether the indented first line of a paragraph is exported to the output document, and if so, whether the indention size is predefined or calculated. Depending on the value of this property, the FirstLineIndent property may contain the length of the indentation of the first line of the paragraph.

The LineSpacingMode property indicates whether the line spacing is exported to the output document, and if so, whether the value is predefined or calculated. Depending on the value of this property, the LineSpacing property may contain the line spacing to be exported.

The AlignmentMode property indicates whether the paragraph alignment is exported to the output document, and if so, whether the value is predefined or calculated. Depending on the value of this property, the Alignment property may contain the alignment type to be exported.


Using the Character Options

The recognition result options, which include character options, indicate how the recognition results are saved, and exactly what is output. To get the current options used by the OCR engine to save the recognition results, call the GetRecognitionResultOptions method. This method updates the ResultOptions property, which accesses the CharacterOptions property, with the current settings. This property is a pointer to an ILTCharacterOptions object. While the CharacterOptions property is read only, the ILTCharacterOptions properties accessed through it can be set. To set new character options, set the ILTCharacterOptions properties, accessed through the CharacterOptions property of the ResultOptions property (for example RasterDoc.ResultOptions.CharacterOptions.Size = 24) and then set the new options for the OCR engine by calling the SetRecognitionResultOptions method.

Various character characteristics of the OCR document may be exported to the output document following recognition. The SelOutputFont property indicates whether the font names and character sizes are exported to the output document, and if so, whether the character size is predefined or calculated. Depending on the value of this property, the FontNames property may contain the font names to be exported and the Size property may contain the character size to be exported.

During recognition, the OCR engine may encounter characters that are bold, italic or underlined. The Bold, Italic and Underline properties indicate how these characters will be output. The Bold property indicates whether a bold character will be output as bold. If the OCR engine recognizes a bold character, but the Bold property is FALSE, the recognized bold character will be output as a plain character. The Italic property indicates whether an italic character will be output as italic and the Underline property indicates whether underlined characters will be output as underlined.


Using the Mark Options

The recognition result options, which include mark options, indicate how the recognition results are saved, and exactly what is output. To get the current options used by the OCR engine to save the recognition results, call the GetRecognitionResultOptions method. This method updates the ResultOptions property, which accesses the MarkOptions property, with the current settings. This property is a pointer to an ILTMarkOptions object. While the MarkOptions property is read only, the ILTMarkOptions properties accessed through it can be set. To set new mark options, set the ILTMarkOptions properties, accessed through the MarkOptions property of the ResultOptions property (for example RasterDoc.ResultOptions.MarkOptions.ColorSuspectCharacter = COL_BW) and then set the new options for the OCR engine by calling the SetRecognitionResultOptions method.

Various mark characteristics of the OCR document, used to describe special characters, words, separators or symbols, may be exported to the output document following recognition. Colors used to output suspect characters or words are in the ColorSuspectCharacter and ColSuspectWord properties. The colors used to output missing symbols or rejection symbols are in the ColMissingSymbol and ColRejectionSymbol properties.

Separators are used before suspect characters, missing symbols and rejection symbols. These separators are in the SeparatorBeforeSuspectCharacter, SeparatorBeforeMissingSymbol and SeparatorBeforeRejectionSymbol properties.

In addition, separators are before and after suspect words, lines, table rows, paragraphs, zones and pages. These separators can be found in the following properties:

SeparatorStartSuspectWord property | SeparatorEndSuspectWord property
SeparatorStartLine property | SeparatorEndLine property
SeparatorStartTableRow property | SeparatorEndTableRow property
SeparatorStartParagraph property | SeparatorEndParagraph property
SeparatorStartZone property | SeparatorEndZone property
SeparatorStartPage property | SeparatorEndPage property


Output Converter Formatting Properties

In the final output document, not all possible formatting features can be used, since either they were not applicable or they were not implemented for that particular converter. For example, specifying the page margins in conjunction with a text output converter won't have any effect. The formatting parameters for the final output document can be controlled using SetRecognitionResultOptions and GetRecognitionResultOptions.

The table below summarizes what features were implemented for the different converters.

Output Converter | Document Options | Paragraph Options | Character Options | Mark Options
"Text – Standard" | No effect | No effect | No effect | Colors no, markers yes
"Text – Smart" | No effect, except Left Margin | No effect | No effect | Colors no, markers yes
"Text – Stripped" | No effect | No effect | No effect | Colors no, markers yes
"Text – Plain" | No effect, except Left- and Upper Margin | No effect | No effect | Colors no, markers yes
"Text – Comma Delimited" | No effect, except Table | No effect | No effect | Colors no, markers yes
"Text – Tab Delimited" | No effect, except Table | No effect | No effect | Colors no, markers yes
"Rec ASCII (Standard) " | No effect, except Page Breaks | No effect | No effect | Colors no, markers yes
"Rec ASCII (StandardEx)" | No effect, except Page Breaks | No effect | No effect | Colors no, markers yes
"Rec ASCII (Formatted)" | No effect | No effect | No effect | No effect
"General Word Processor" | No effect, except Page Breaks | No effect | No effect | Colors no, markers yes
"Adobe PDF" | No effect, except Graphics | No effect | No effect, except Bold, underline, Italic | No effect
"Adobe PDF with image substitutes" | No effect, except Graphics | No effect | No effect, except Bold, Underline, Italic | No effect
"Adobe PDF with image on text" | No effect, except Graphics | No effect | No effect, except Bold, Underline, Italic | No effect
"Adobe PDF image only" | No effect, except Graphics | No effect | No effect, except Bold, Underline, Italic | No effect
"Adobe PDF edited" | Yes | Yes | Yes | Yes
"HTML 4.0" | Yes, but no Orientation, Size, Break, Margin, Language | Yes | Yes | Yes
"HTML 3.2" | Yes, but no Paper Orientation, Size, Break, Margin, Language | Yes | No font types | Yes
"Word 97, 2000, XP" | Yes | Yes | Yes | Yes
"Excel 97, 2000" | Yes | Yes | Yes | Colors yes, markers no.
"WordPerfect 8" | Yes | Yes | Yes | Yes
"Rich Text Format" | Yes | Yes | Yes | Yes
"PowerPoint 97 (RTF)" | No embedded images, no tables as cells, no frames | Yes | Yes | Colors no, markers yes.
"Publisher 98 (RTF)" | No embedded images, no tables as cells, no frames | Yes | Yes | Colors no, markers yes.
"WordPad (RTF)" | Yes | Yes | Yes | Yes
"RTF Word 2000" | Yes | Yes | Yes | Yes
"RTF Word 97" | Yes | Yes | Yes | Yes
"RTF Word 6.0/95" | Yes | Yes | Yes | Yes
"Open eBook 1.0" | No | Yes | Yes | Yes
"XML" | No | No | No | Yes
"2G Type 2" | No | No effect | No effect | Colors no, markers yes.
"2G Type 3" | No | No effect | No effect | Colors no, markers yes.


Output Text Format List

The following table summarizes the output text formats available in the OCR engine. One of these can be specified as the format for the final output document. The file containing each output converter is also given.

NAME OF THE OUTPUT FORMAT | DESCRIPTION
"Text - Standard" | Text output with line break after each line. If table is present, its cells are positioned by TABs. The output converter is stored in "R4R11T.DLN".
"Text - Smart" | Text output with line break after each line. Left margin is taken into account (with SPACEs) If a table is present; its cells are positioned by SPACEs. The output converter is stored in "R4R11T.DLN".
"Text - Stripped" | Text output with line break after each paragraph. If table is present, its cells are separated by TABs. The output converter is stored in "R4R11T.DLN".
"Text - Plain" | Text output with line break after each line. Left and Upper margins are is taken into account (with SPACEs and NEWLINEs) If table is present, its cells are positioned by TABs. The output converter is stored in "R4R11T.DLN".
"Text - Comma Delimited" | Comma delimited text output. Line/cell contents are surrounded by quotes (""). The default delimiter (comma) can be overwritten (see the REC_OUT.ini file). The output converter is stored in "R4R11T.DLN".
"Text - Tab Delimited" | TAB separated text output. Line/cell contents are surrounded by quotes (""). The output converter is stored in "R4R11T.DLN".
"Rec ASCII (Formatted)" | Text output, layout retention with mimicked SPACEs. Line/cell contents are surrounded by quotes (""). The output converter is stored in "R4R07T.DLN".
"Rec ASCII (Standard)" | Text output allowing quick text conversion. Kept for compatibility reasons. The output converter is stored in "R4R04T.DLN".
"Rec ASCII (StandardEx)" | Text output allowing quick text conversion. Line break after each line and after each zone. Kept for compatibility reasons. The output converter is stored in "R4R08T.DLN".
"General Word Processor" | Text output allowing quick text conversion. Line break after each paragraph. Kept for compatibility reasons. The output converter is stored in "R4R01T.DLN".
"Adobe PDF" | Displaying the generated PDF file in a PDF-reader results in a very similar look to the original document. The text can be searched. The PDF file contains the recognized characters in the same positions as in the original.
"Adobe PDF with image substitutes" | As above, but the problematic recognition cases are handled by the inclusion of smaller image snippets in the output file taken from the original image. Image snippets are also exported for the following cases:- words containing suspect character(s) in the recognized text.- words not approved by the checking subsystem ("non-dictionary" words)- words containing rejection symbol(s)- words containing missing symbol(s).
"Adobe PDF with image on text" | The generated PDF file contains one image for each page in the document and also contains the recognized characters underneath. Displaying the generated PDF file in a PDF-reader results in a very similar look to the original document. The text can be searched..
"Adobe PDF image only" | The generated PDF file contains one image for each page in the document. The file won't contain characters at all, so the text cannot be searched.
"Adobe PDF edited" | The text can be searched. The PDF file contains the recognized characters in the same positions as in the original.
 | Use this output format only if the application has made any change to the recognition result through the GetRecognizedCharacters and SetRecognizedCharacters methods.
"HTML 3.2" | HTML output. HTML 3.2 is useful to export with FORMAT_LEVEL_PART. The output files support both IE and Netscape.
"HTML 4.0" | HTML output. HTML 4.0 can set the exact position/size of objects, use this output format with the FORMAT_LEVEL_FULL option.
"Word 97, 2000, XP" | Microsoft Word 97, Word 2000 and Word XP output format.
"Excel 97, 2000" | Microsoft Excel 97 and Excel 2000 output format.
"WordPerfect 8" | WordPerfect 8 format.
"Rich Text Format" | Quick conversion to Rich Text Format.
"PowerPoint 97 (RTF)" | Rich Text Format for PowerPoint 97
"Publisher 98 (RTF)" | Rich Text Format for Publisher 98
"WordPad (RTF)" | Rich Text Format for WordPad
"RTF Word 2000" | Rich Text Format for Word 2000
"RTF Word 97" | Rich Text Format for Word 97
"RTF Word 6.0/95" | Rich Text Format for Word 6.0/95
"Open eBook 1.0" | Open eBook 1.0 format
"XML" | XML output format conforming with ScanSoft's schema file SSDOC-SCHEMA2.xmlhttp:\\www.scansoft.com/omnipage/xml/SSDOC-SCHEMA2.xml
"2G Type 2" | Binary output of the recognition with a 16-byte long structure for each recognized character.2G Type 2 structure output
"2G Type 3" | Binary output of the recognition with a 16-byte long structure for each recognized character.2G Type 3 structure output


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, demonstration programs and online help. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

BIN | Executable files for the demonstration programs.
HELP | Online help files.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
LIB | Library files.
REDIST\OCR | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


Files To Be Included With Your Application

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation. The following subdirectory is created:

REDIST\OCR

Redistributable OCR files.

Note: | You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.
Note: | You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions. Most files in the table are optional. 32-bit DLLs are listed. These files are referred to as "Redistributables" in the License Agreement.

Please note that LTR and LTRVR are required for all COM applications. For more information on LTR, LTRVR, or other files for the Main COM, refer to Files To Be Included With Your Application.

Note: All Unicode versions of LEADTOOLS require Microsoft Unicode Layer for Windows (UNICOWS.DLL) in order to function on Windows 95/98/Me. You can obtain MSUL from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_mslu.asp.

Redistributables:

Explanation:

If you are using a standard release without Unicode, the files to use are:

If you are using a standard release with Unicode, the files to use are:

If you are using an evaluation release without Unicode, the files to use are:

If you are using an evaluation release with Unicode, the files to use are:

LTRDC

LEADTOOLS OCR support. LTRDC14N.DLL is the LEADTOOLS OCR Support DLL.

DLL:
LTRDC14N.DLL

DLL:
LTRDC14NU.DLL

DLL:
LTRDC14E.DLL

DLL:
LTRDC14EU.DLL

LEADv122.lic

License file

For this file and all files below this point in the table, the same files are used for all versions.

For this file and all files below this point in the table, the same files are used for all versions.

For this file and all files below this point in the table, the same files are used for all versions.

For this file and all files below this point in the table, the same files are used for all versions.

RNAPI.DLL

Main ScanSoft module DLL

RNERR.DLL

Error string DLL

AMPLM.dll

ScanSoft licensing DLL

RecDiag.dll

Diagnostic DLL

RECOGN.SET

Code Page Definition file containing pre-defined mostly ASCII-based Code Pages

PDREAD.DLL

PDF reading support main module DLL

P4DLL.DLL

PDF reader DLL

P4DLL.VM

PDF reading support

PSMAXAPI.DLL

PaperPort MAX file support

MRCR3_1s.DLL

TIFF-FX reading support

MORPF.DLL

Page orientation detection DLL

CUD.dll

Part of Spell Checking System

CURTWORD.dat

internal Knowledge base file

ICDLLW32.DLL

Third-party spell checker (for Polish/Hungarian)

ICHUNW32.DLL

Third-party spell checker executable

MOR.DLL

Page orientation detection DLL

OURDICT.DAT

internal Knowledge base file

RECOGN.BCT

Knowledge base file for the MORPF module

RECOGN24.BCT

Knowledge base file for MOR engine

REGEXP.DLL

Regular expression DLL

Rfc12.dll

Needed for Flowing Column output

rndsdawg.dll

Interface to third-party spell checkers (.DMD)

RNDSINSO.DLL

Interface to third-party spell checkers (.DAT)

RNFMAN.DLL

Part of the Image Handling module

TEV.SZO

OCR-specific spell replacement file

xocr.dll

Mango DLL (DCM_STANDARD)

XOCR32B.exe

Main module executable

bnt.dll

Main MTX module DLL

Firewrx.dll

Main FRX module DLL

RM_MAT.INI

Sample RM-specific parameter file

RNDOT.DLL

Main DOT module DLL

RNMATRIX.DLL

Main MAT module DLL

SFOCR.TUD

Knowledge MAT base file

TUDAS.FA

Knowledge base file - 9-pin dot-matrix

Language Dictionary Files

asciieng.lng

Frx language dictionary. Used in case of multi-language selection

BALTIC.shp

Frx shape pack (code page) file

CharSetTable.chr

Frx language dictionary. Used in case of multi-language selection

CYRILLIC.shp

Frx shape pack (code page) file

czech.lng

Frx language dictionary data file

danish.lng

Frx language dictionary data file

dutch.lng

Frx language dictionary data file

english.lng

Frx language dictionary data file

finnish.lng

Frx language dictionary data file

french.lng

Frx language dictionary data file

german.lng

Frx language dictionary data file

greek.lng

Frx language dictionary data file

GREEK.shp

Frx shape pack (code page) file

hungar.lng

Frx language dictionary data file

italian.lng

Frx language dictionary data file

LATIN1.shp

Part of the FRX module

LATIN2.shp

Part of the FRX module

norsk.lng

Frx language dictionary data file

polish.lng

Frx language dictionary data file

port.lng

Frx language dictionary data file

russian.lng

Frx language dictionary data file

spanish.lng

Frx language dictionary data file

swedish.lng

Frx language dictionary data file

turkish.lng

Frx language dictionary data file

TURKISH.shp

Frx shape pack (code page) file

R_cat.dat

Catalan language dictionary data file

R_czh.dat

Czech language dictionary data file

R_dan.dat

Danish language dictionary data file

R_dut.dat

Dutch language dictionary data file

R_ENG.DAT

English language dictionary data file

R_fin.dat

Finnish language dictionary data file

R_fre.dat

French language dictionary data file

R_ger.dat

German language dictionary data file

R_gre.dat

Greek language dictionary data file (Greek alphabet)

R_hun.dat

Hungarian language dictionary data file

R_ita.dat

Italian language dictionary data file

R_nor.dat

Norwegian language dictionary data file

R_pol.dat

Polish language dictionary data file

R_por.dat

Portuguese language dictionary data file

R_rus.dat

Russian language dictionary data file (Cyrillic alphabet)

R_spa.dat

Spanish language dictionary data file

R_swe.dat

Swedish language dictionary data file

R_SLN.dmd

Slovenian language dictionary data file

Converter Files:

ATM2LLL.DLL

Required for DLC converters

CDK2000.DAT

Engine License/ Keycode file

eBookConv.dlc

"Open eBook 1.0" converter

EXCELcnv.dlc

"Excel 97, 2000" converter

FORMATTER.DLL

Formatter DLL (required for DLC converters)

HTMLcnv.dlc

"HTML 3.2" and "HTML 4.0" converters

LECSOMGR.DLL

"Lecso" manager DLL (required for DLC converters)

PDFcnv.dlc

PDF converters (available if PDF-output license is present)

PRERENDERING.DLL

Pre-renderer DLL (required for DLC converters)

r4r01t.dln

"General Word Processor" converter

r4r03t.dln

"2G" converters

r4r04t.dln

"Rec ASCII (Standard)" converter

r4r05t.dln

"Rich Text format" converter

r4r07t.dln

"Rec ASCII (Formatted)" converter

r4r08t.dln

"Rec ASCII (StandardEx)" converter

R4R11T.DLN

ATM to Lecso converter (required for DLC converters)

REC_OUT.INI

Output converter configuration file

RENDERING.DLL

Renderer DLL (required for DLC converters)

RenderingExt.dat

Renderer configuration file

RTFconv.dlc

RTF converters

TXTconv.dlc

Different text converters

WORDcnv.dlc

"Word 97, 2000, XP" converter

WPcnv.dlc

"WordPerfect 8" converter

XMLConv.dlc

"XML" converter

Recognition Module Files:

HAND.REC

Knowledge base file for alpha characters for RER recognition module

NUMPLUS.REC

Knowledge base file for digits for RER recognition module

KADMOS.UK

Knowledge base file for RER recognition module

RM_RER.INI

Sample RM-specific parameter file for RER recognition module

RNICR2.DLL

Main RER module DLL

KEZIRSTR.TBS

Knowledge base file for HNR

RNICR.DLL

Main HNR module DLL

RNOMR.DLL

Main OMR module DLL

Language Files for the MTX engine:

XINRWP.BIN

All of the .BIN files are language files for the MTX engine

XIBRTC.BIN

XIBRTD.BIN

XIBRTE.BIN

XIBRTP.BIN

XIBRTS.BIN

XIBRTZ.BIN

XIBRZB.BIN

XIBRZC.BIN

XIBRZD.BIN

XIBRZE.BIN

XIBRZP.BIN

XIBRZZ.BIN

XIBRZS.BIN

XIDANB.BIN

XIDANC.BIN

XIDAND.BIN

XIDANE.BIN

XIDANP.BIN

XIDANS.BIN

XIDANZ.BIN

XIDUTB.BIN

XIDUTC.BIN

XIDUTD.BIN

XIDUTE.BIN

XIDUTP.BIN

XIDUTS.BIN

XIDUTZ.BIN

XIENGB.BIN

used unaltered for all languages

XIENGC.BIN

used unaltered for all languages

XIENGD.BIN

used unaltered for all languages

XIENGE.BIN

used unaltered for all languages

XIENGF.BIN

used unaltered for all languages

XIENGL.BIN

used unaltered for all languages

XIENGP.BIN

used unaltered for all languages

XIENGS.BIN

used unaltered for all languages

XIENGZ.BIN

used unaltered for all languages

XIFINB.BIN

All of the .BIN files are language files for the MTX engine

XIFINC.BIN

XIFIND.BIN

XIFINE.BIN

XIFINP.BIN

XIFINS.BIN

XIFINZ.BIN

XIFRNB.BIN

XIFRNC.BIN

XIFRND.BIN

XIFRNE.BIN

XIFRNP.BIN

XIFRNS.BIN

XIFRNZ.BIN

XIGRMB.BIN

XIGRMC.BIN

XIGRMD.BIN

XIGRME.BIN

XIGRMP.BIN

XIGRMS.BIN

XIGRMZ.BIN

XIITLB.BIN

XIITLC.BIN

XIITLD.BIN

XIITLE.BIN

XIITLP.BIN

XIITLS.BIN

XIITLZ.BIN

XINRWB.BIN

XINRWC.BIN

XINRWD.BIN

XINRWE.BIN

XIBRTB.BIN

XINRWS.BIN

XINRWZ.BIN

XIPRTB.BIN

XIPRTC.BIN

XIPRTD.BIN

XIPRTE.BIN

XIPRTP.BIN

XIPRTS.BIN

XIPRTZ.BIN

XISPNB.BIN

XISPNC.BIN

XISPND.BIN

XISPNE.BIN

XISPNP.BIN

XISPNS.BIN

XISPNZ.BIN

XISWDB.BIN

XISWDC.BIN

XISWDD.BIN

XISWDE.BIN

XISWDP.BIN

XISWDS.BIN

XISWDZ.BIN


A Special Note About UNICODE Support

LEADTOOLS now provides UNICODE support. However, in order to utilize the examples and tutorials in this help file with UNICODE, you must make a few substitutions for class names, IDs, event names, etc. This is true for VB, MFC, Delphi and C++ Builder. Before attempting to compile the samples or tutorials in this help file for UNICODE, replace the class name, ID name, event name, etc. in the first column below, with the corresponding name in the second column. As you can see, this just involves adding "_U" to the end of the class name, ID name, event name, etc.

General Notes For VC++ Programmers:

1.

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
ILEADRasterXXXX | ILEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

For example:

ILEADRasterIO_U *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO_U, NULL, CLSCTX_ALL, IID_ILEADRasterIO_U, (void**)&pRasterIO);

2.

For importing (.DLL) or (.OCX) files in your project:

Replace: | With:
LTRXXXN.OCX | LTRXXXNU.OCX
LTRXXXN.DLL | LTRXXXNU.DLL

For example:

#import "c:\\winnt\\system32\\ltrvr14nu.dll" no_namespace, named_guids

#import "c:\\winnt\\system32\\ltrvw14nu.ocx" no_namespace, named_guids

General Notes For VB Programmers:

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
LEADRasterXXXX | LEADRasterXXXX_U
LEADRasterXXXX_EventName | LEADRasterXXXX_U_EventName
LEADRasterXXXX.LEADRasterXXXX | LEADRasterXXXX_U.LEADRasterXXXX_U

When adding a Reference or Component to a Visual Basic project, be sure that the desired Reference or Component name ends with (_U).

For example:

To add the Unicode version of LEAD RasterView Control to your project, you have to select LEAD Raster View_U Control (14).

General Notes For Delphi and C++ Builder Programmers:

Replace: | With:
LTRASTERXXXLib_TLB | LTRASTERXXXLib_U_TLB
ILEADRasterXXXX | ILEADRasterXXXX_U
CLASS_LEADRasterXXXX | CLASS_LEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

Note:

When adding an ActiveX Control or Import type library to a Delphi or C++ Builder project, be sure that the desired ActiveX Control or Library name ends with (_U).

For example:

To add the Unicode version of LEAD Raster View Control to your project, you have to select LEAD Raster View_U Control (14).


Tutorial for ASP - JavaScript Programmers

The following topics provide brief and simple examples to help you learn how to use the LEAD OCR Object Library.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax .

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Pages


Working with Pages (ASP - JavaScript)

Copy and paste the following code into an ASP file to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

<%@ Language=JavaScript %>
<%
var LEADRaster = Server.CreateObject("LEADRaster.LEADRaster.140");
var LEADRasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO.140");
var LEADRasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess.140");
var LEADRasterDoc = Server.CreateObject("LEADRasterDocument.LEADRasterDocument.140");
var ZoneData = Server.CreateObject("LTZoneData.LTZoneData.140");

function SetActiveLangs()
{
var nRet;
var LANGID_ENGLISH = 0;

LEADRasterDoc.ActiveLanguagesCount = 1;
LEADRasterDoc.ActiveLanguage(0) = LANGID_ENGLISH;
nRet = LEADRasterDoc.SelectLanguages();
if (nRet != 0)
Response.Write("Error " + nRet + "Setting English as default language" + "<BR>");
else
Response.Write("English is Set as the active language" + "<BR>");
}

function AddPage()
{
var L_SUPPORT_OCR = 3;

LEADRaster.UnlockSupport
 (L_SUPPORT_OCR, "OCR Key Goes Here");
LEADRasterDoc.StartUp();

var nPageNumber;
var nRet;

nRet = LEADRasterIO.Load (LEADRaster, "D:\\Ocr\\LETTER.TIF", 0, 0, 1);
if (nRet != 0)
Response.Write("Error loading file" + "<BR>");

nRet = LEADRasterDoc.AddPage(LEADRaster, nPageNumber);
if (nRet == 0)
Response.Write("Page Width = " + LEADRasterDoc.PageWidth(nPageNumber) + "<BR>" + "Page Height = " + LEADRasterDoc.PageHeight(nPageNumber) + "<BR>" + "Page Bits Per Pixel = " + LEADRasterDoc.PageBitsPerPixel(nPageNumber) + "<BR>");
else
Response.Write("The engine could not add a new page to the Document" + "<BR>");

SetActiveLangs();
}

function RemovePage()
{
var nRet;
var nPageCount;
var i;

nPageCount = LEADRasterDoc.PageCount;
for (i = 0; i < nPageCount; i++)
{
nRet = LEADRasterDoc.RemovePage(i);
if (nRet = 0)
Response.Write("The page # " + i + "is removed successfully" + "<BR>");
else
Response.Write("The page # " + i + "is not removed successfully" + "<BR>");
}
}

function FlipPage()
{
var nRet;

nRet = LEADRasterDoc.ExportPage(LEADRaster, 0);
LEADRasterProc.Flip
 (LEADRaster);
nRet = LEADRasterDoc.UpdatePage(LEADRaster, 0);
if (nRet == 0)
Response.Write("The specified page is updated successfuly" + "<BR>");
else
{
Response.Write("Error " + nRet + " in updating page bitmap for page # 0" + "<BR>");
LEADRasterDoc.ActivePageIndex = 0;
}
}

AddPage();
FlipPage();
RemovePage();
%>


Working with Zones (ASP - JavaScript)

Take the following steps to add code to the existing page that will let you manipulate zones:

1. | Start with the program you created in Working with Pages
2. | Add the following code to the file before the call to AddPage():

function FindZones()
{
var nRet;
LEADRasterDoc.GetAutoZoneOptions();
LEADRasterDoc.EnableZoneForceSingleColumn = true;
LEADRasterDoc.ShowZoneGridLines = true;

LEADRasterDoc.SetAutoZoneOptions();
nRet = LEADRasterDoc.FindZones(0, true);
if (nRet == 0)
Response.Write("Automatic zones method finds all available zones into the specified pages successfully" + "<BR>");
else
Response.Write("Error" + nRet + "in finding available zone in the specified page" + "<BR>");
}

function ZonesCount()
{
var nZoneCount;
nZoneCount = LEADRasterDoc.ZoneCount(0);
Response.Write("Total Zones count = " + nZoneCount + "<BR>");
}

3.

Add the following code before the call to RemovePage():

FindZones();
ZonesCount();

4. | Run your page to test it.
5. | Save this page to use for testing other code samples.


Recognizing Pages (ASP - JavaScript)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages
2. | Add the following code to the file before the call to AddPage():

function Recognize()
{
var nRet;
var LANGID_ENGLISH = 0;
LEADRasterDoc.SpellLanguageID = LANGID_ENGLISH;
LEADRasterDoc.EnableSubSystem = true;
LEADRasterDoc.EnableCorrection = true;

LEADRasterDoc.RecognitionDataFileName = "D:\\Ocr\\LETTER.TIF";

nRet = LEADRasterDoc.Recognize(0, 1);
if (nRet == 0)
Response.Write("The engine finished recognizing the specified pages successfully" + "<BR>");
else
Response.Write("Error" + nRet + "in recognized specified pages" + "<BR>");
}

function GetStatus()
{
var nRet;
LEADRasterDoc.EnableFireRecognizeStatus = true;
nRet = LEADRasterDoc.GetStatus();
if (nRet == 0)
Response.Write("Recognition Time = " + LEADRasterDoc.RecognizeStatus.RecognizedTime + "<BR>" +
"Total Recognized Characters = " + LEADRasterDoc.RecognizeStatus.RecognizedCharacterCount + "<BR>" +
"Total Recognized Words = " + LEADRasterDoc.RecognizeStatus.RecognizedWordCount + "<BR>" +
"Total Rejected Characters = " + LEADRasterDoc.RecognizeStatus.RejectCharacterCount + "<BR>" +
"Total Rejected Words = " + LEADRasterDoc.RecognizeStatus.RejectWordCount + "<BR>");
}

3.

Add the following code before the call to RemovePage():

Recognize();
GetStatus();

4. | Run your page to test it.
5. | Save this page to use for testing other code samples.


Tutorial for ASP - VBScript Programmers

The following topics provide brief and simple examples to help you learn how to use the LEAD OCR Object Library.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax .

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Pages


Working with Pages (ASP - VBScript)

Copy and paste the following code into an ASP file to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

<%@ Language=VBScript%>
<%
Dim LEADRaster
Dim LEADRasterIO
Dim LEADRasterProc
Dim LEADRasterDoc
Dim ZonData

Set LEADRaster = Server.CreateObject("LEADRaster.LEADRaster.140")
Set LEADRasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO.140")
Set LEADRasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess.140")
Set LEADRasterDoc = Server.CreateObject("LEADRasterDocument.LEADRasterDocument.140")
Set ZoneData = Server.CreateObject("LTZoneData.LTZoneData.140")

Sub SetActiveLangs()
Dim nRet
Dim LANGID_ENGLISH

LANGID_ENGLISH = 0
LEADRasterDoc.ActiveLanguagesCount = 1
LEADRasterDoc.ActiveLanguage(0) = LANGID_ENGLISH
nRet = LEADRasterDoc.SelectLanguages()
If (nRet <> 0) Then
Response.Write "Error " + CStr(nRet) + "Setting English as default language"+ "<BR>"
Else
Response.Write "English is Set as the active language" + "<BR>"
End If
End Sub

Sub AddPage()
Dim L_SUPPORT_OCR
L_SUPPORT_OCR = 3

LEADRaster.UnlockSupport
  L_SUPPORT_OCR, "OCR Key Goes Here"
LEADRasterDoc.StartUp

Dim nPageNumber
Dim nRet

nRet = LEADRasterIO.Load (LEADRaster, "D:\Ocr\LETTER.TIF", 0, 0, 1)
If (nRet <> 0) Then
Response.Write "Error loading file" + "<BR>"
End If

nRet = LEADRasterDoc.AddPage(LEADRaster, nPageNumber)
If (nRet = 0) Then
Response.Write "Page Width = " + CStr(LEADRasterDoc.PageWidth(nPageNumber)) + Chr(13) + "Page Height = " + CStr(LEADRasterDoc.PageHeight(nPageNumber)) + Chr(13) + "Page Bits Per Pixel = " + CStr(CStr(LEADRasterDoc.PageBitsPerPixel(nPageNumber))) + "<BR>"
Else
Response.Write "The engine could not add a new page to the Document" + "<BR>"
End If

SetActiveLangs
End Sub

Sub RemovePage()
Dim nRet
Dim nPageCount
Dim I

nPageCount = LEADRasterDoc.PageCount
For i = 0 To  nPageCount - 1
nRet = LEADRasterDoc.RemovePage(i)
If (nRet = 0) Then
Response.Write "The page # " + CStr(i) + "is removed successfully" + "<BR>"
End If
Next
End Sub

Sub FlipPage()
Dim nRet

nRet = LEADRasterDoc.ExportPage(LEADRaster, 0)
LEADRasterProc.Flip
  LEADRaster
nRet = LEADRasterDoc.UpdatePage(LEADRaster, 0)
If (nRet = 0) Then
Response.Write "The specified page is updated successfuly" + "<BR>"
Else
Response.Write "Error " + CStr(nRet) + " in updating page bitmap for page # 0" + "<BR>"
LEADRasterDoc.ActivePageIndex = 0
End If
End Sub

AddPage
FlipPage
RemovePage
%>


Working with Zones (ASP - VBScript)

Take the following steps to add code to the existing page that will let you manipulate zones:

1. | Start with the program you created in Working with Pages
2. | Add the following code to the file before the call to AddPage():

Sub FindZones()
Dim nRet
LEADRasterDoc.GetAutoZoneOptions
LEADRasterDoc.EnableZoneForceSingleColumn = True
LEADRasterDoc.ShowZoneGridLines = True

LEADRasterDoc.SetAutoZoneOptions
nRet = LEADRasterDoc.FindZones(0, True)
If (nRet = 0) Then
Response.Write "Automatic zones method finds all available zones into the specified pages successfully" + "<BR>"
Else
Response.Write "Error" + CStr(nRet) + "in finding available zone in the specified page" + "<BR>"
End If
End Sub

Sub ZonesCount()
Dim nZoneCount
nZoneCount = LEADRasterDoc.ZoneCount(0)
Response.Write "Total Zones count = " + CStr(nZoneCount) + "<BR>"
End Sub

3.

Add the following code before the call to RemovePage():

FindZones
ZonesCount

4. | Run your page to test it.
5. | Save this page to use for testing other code samples.


Recognizing Pages (ASP - VBScript)

Take the following steps to add code to the existing page that will let you recognize pages:

1. | Start with the program you created in Working with Pages
2. | Add the following code to the file before the call to AddPage():

Sub Recognize()
Dim nRet
Dim LANGID_ENGLISH

LANGID_ENGLISH = 0
LEADRasterDoc.SpellLanguageID = LANGID_ENGLISH
LEADRasterDoc.EnableSubSystem = True
LEADRasterDoc.EnableCorrection = True

LEADRasterDoc.RecognitionDataFileName = "D:\Ocr\LETTER.TIF"

nRet = LEADRasterDoc.Recognize(0, 1)
If (nRet = 0) Then
Response.Write "The engine finished recognizing the specified pages successfully" + "<BR>"
Else
Response.Write "Error" + CStr(nRet) + "in recognized specified pages" + "<BR>"
End If
End Sub

Sub GetStatus()
Dim nRet
nRet = LEADRasterDoc.GetStatus()
If (nRet = 0) Then
Response.Write "Recognition Time = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedTime) + "<BR>" + _
"Total Recognized Characters = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedCharacterCount) + "<BR>" + _
"Total Recognized Words = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedWordCount) + "<BR>" + _
"Total Rejected Characters = " + CStr(LEADRasterDoc.RecognizeStatus.RejectCharacterCount) + "<BR>" + _
"Total Rejected Words = " + CStr(LEADRasterDoc.RecognizeStatus.RejectWordCount) + "<BR>"
End If
End Sub

3.

Add the following code before the call to RemovePage():

Recognize
GetStatus

6. | Run your page to test it.
5. | Save this page to use for testing other code samples.


Tutorial for Visual Basic Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS COM Objects.

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Pages

Working with Recognition Results

Painting Pages and Zones

Miscellaneous Examples


Working with Pages (Visual Basic)

Working with Pages

Take the following steps to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

1. | Start Visual Basic.
2. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14).
3. | Add the LEAD Raster Process Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Process Object Library (14).
4. | Add the LEAD Raster OCR Document Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster OCR Document Object Library (14).
5. | Add the LEAD Raster IO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster IO Object Library (14).
6. | Add a command button to your form and name it as follows:
 | Name | Caption
 | STARTUP | Start Up
 | ADDPAGE | Add Page
 | SETLANGUAGES | Set Langs
 | SHUTDOWN | Shut Down
 | REMOVEPAGE | Remove Page
 | FLIPPAGE | Flip Page
7. | Add the following code to the general declarations section of your project:

Dim WithEvents LEADRasterDoc As LEADRasterDocument
Dim LeadRaster As New LeadRaster
Dim LeadRasterIO as New LEADRasterIO

8.

Add the following initialization code to the main form's Load procedure. In Online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Set LEADRasterDoc = New LEADRasterDocument
End Sub

9.

Code the STARTUP button's click procedure as follows:

Private Sub STARTUP _Click()
' notice the OCR key is a test key.
LeadRaster.UnlockSupport L_SUPPORT_OCR, "TestKey"
LEADRasterDoc.StartUp
End Sub

10.

Code the SHUTDOWN button's click procedure as follows:

Private Sub SHUTDOWN_Click()
LEADRasterDoc.ShutDown
End Sub

11.

Code the ADDPAGE button's click procedure as follows:

Private Sub ADDPAGE_Click()
Dim nPageNumber As Long
Dim nRet As Long

nRet = LeadRasterIO.Load(LeadRaster, "c:\OCRTEST.gif", 0, 0, 1)
If (nRet <> 0) Then
MsgBox "Error loading file"
End If

nRet = LEADRasterDoc.ADDPAGE(LeadRaster, nPageNumber)
If (nRet = 0) Then
MsgBox "Page Width = " + Str(LEADRasterDoc.PageWidth (nPageNumber)) + Chr$(13) + _
"Page Height = " + Str(LEADRasterDoc.PageHeight (nPageNumber)) + Chr$(13) + _
"Page Bits Per Pixel = " + Str(Str(LEADRasterDoc.PageBitsPerPixel (nPageNumber)))
Else
MsgBox "The engine could not add a new page to the Document"
End If
End sub

12.

Code the SETLANGUAGES button's click procedure as follows:

Private Sub SETLANGUAGES_Click()
Dim nRet As Long
LEADRasterDoc.ActiveLanguagesCount = 1
LEADRasterDoc.ActiveLanguage (0) = LANGID_ENGLISH
nRet = LEADRasterDoc.SelectLanguages ()
If (nRet <> 0) Then
MsgBox "Error " + Str(nRet) + "Setting English as default language"

Else
MsgBox "English is Set as the active language"
End If

End Sub

13.

Code the REMOVEPAGE button's click procedure as follows:

Private Sub REMOVEPAGE_Click()
Dim nRet As Long
Dim nPageCount As Long
Dim i As Long

nPageCount = LEADRasterDoc.PageCount
For i = 0 To nPageCount - 1
nRet = LEADRasterDoc.REMOVEPAGE(i)
If (nRet = 0) Then
MsgBox "The page # " + Str(i) + "is removed successfully"
End If
Next i
End Sub

14.

Code the FLIPPAGE button's click procedure as follows:

Private Sub FLIPPAGE_Click()
Dim nRet As Long
Dim LEADRasterProc As New LEADRasterProcess
nRet = LEADRasterDoc.ExportPage (LeadRaster, 0)
LEADRasterProc.Flip LeadRaster
nRet = LEADRasterDoc.UpdatePage (LeadRaster, 0)
If (nRet = 0) Then
MsgBox "The specified page is updated successfuly"
Else
MsgBox "Error " + Str(nRet) + " in updating page bitmap for page # 0"
LEADRasterDoc.ActivePageIndex = 0
End If
End Sub

15. | Run your program to test it.
16. | Save this project to use for testing other code samples.


Working with Zones (Visual Basic)

Working with Zones

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | FINDZONES | Find Zones
 | ZONESCOUNT | Zones Count
 | VERIFYZONE | Verify Zone
3. | Add the following code to the general declarations section of your project:

Dim WithEvents ZoneData As LTZoneData

4.

Add the following code to the main form's Load procedure:

Set ZoneData = new LTZoneData

5.

Add the following code to the SHUTDOWN procrdure:

Set ZoneData = Nothing

6.

Code the Verification Event procedure as follows:

Private Sub ZoneData_Verification (ByVal iZoneIndex As Integer, ByVal bstrWord As String)
ZoneData.VerifyCode = VF_ACCEPT
ZoneData.StopVerificationEvent = False
End Sub

7.

Code the FINDZONES button's click procedure as follows:

Private Sub FINDZONES_Click()
Dim nRet As Long
LEADRasterDoc.GetAutoZoneOptions
LEADRasterDoc.EnableZoneForceSingleColumn = True
LEADRasterDoc.ShowZoneGridLines = True

LEADRasterDoc.SetAutoZoneOptions
nRet = LEADRasterDoc.FINDZONES(0, True)
If (nRet = 0) Then
MsgBox "Automatic zones method finds all available zones into the specified pages successfully"
Else
MsgBox "Error" + Str(nRet) + "in finding available zone in the specified page"
End If
End Sub

8.

Code the ZONESCOUNT button's click procedure as follows:

Private Sub ZONESCOUNT_Click()
Dim nZoneCount As Long
nZoneCount = LEADRasterDoc.ZoneCount (0)
MsgBox "Total Zones count = " + Str(nZoneCount)
End Sub

9.

Code the VERIFYZONE button's click procedure as follows:

Private Sub VERIFYZONE_Click()
Dim nZoneCount As Long
Dim nRet As Long
Dim i As Long
nZoneCount = LEADRasterDoc.ZoneCount (0)
For i = 0 To nZoneCount -1
nRet = LEADRasterDoc.GetZoneInfo (0, i, ZoneData)
If (nRet = 0) Then
If ((ZoneData.Flags And ZONE_CHK_CHECKCBF_PROHIBIT) = ZONE_CHK_CHECKCBF_PROHIBIT) Then
ZoneData.Flags = ZoneData.Flags And (Not ZONE_CHK_CHECKCBF_PROHIBIT)
End If

ZoneData.EnableVerificationEvent = True
nRet = LEADRasterDoc.UpdateZone (0, i, ZoneData)
If (nRet <> 0) Then
MsgBox "Error" + Str(nRet) + "in updating zone # " + Str(i)
End If
End If
Next i
End Sub

10. | Run your program to test it.
11. | Save this project to use for testing other code samples.


Recognizing Pages (Visual Basic)

Recognizing Pages

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones.
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | RECOGNIZE | Recognize
 | GETSTATUS | Get Status
3. | Code the RECOGNIZE button's click procedure as follows:

Private Sub RECOGNIZE_Click()
Dim nRet As Long
LEADRasterDoc.SpellLanguageID = LANGID_ENGLISH
LEADRasterDoc.EnableSubSystem = True
LEADRasterDoc.EnableCorrection = True

LEADRasterDoc.RecognitionDataFileName = "c:\testrdf.rdf"

nRet = LEADRasterDoc.RECOGNIZE(0, 1)
If (nRet = 0) Then
MsgBox "The engine finished recognizing the specified pages successfully"
Else
MsgBox "Error" + Str(nRet) + "in recognized specified pages"
End If
End Sub

4.

Code the GETSTATUS button's click procedure as follows:

Private Sub GETSTATUS_Click()
Dim nRet As Long
nRet = LEADRasterDoc.GetStatus ()
If (nRet = 0) Then
MsgBox "Recognition Time = " + Str(LEADRasterDoc.RecognizeStatus.RecognizedTime) + Chr$(13) + _
"Total Recognized Characters = " + Str(LEADRasterDoc.RecognizeStatus.RecognizedCharacterCount) + Chr$(13) + _
"Total Recognized Words = " + Str(LEADRasterDoc.RecognizeStatus.RecognizedWordCount) + Chr$(13) + _
"Total Rejected Characters = " + Str(LEADRasterDoc.RecognizeStatus.RejectCharacterCount) + Chr$(13) + _
"Total Rejected Words = " + Str(LEADRasterDoc.RecognizeStatus.RejectWordCount)
End If
End Sub

5.

Code the RecognitionStatus Event procedure as follows:

Private Sub LEADRasterDoc_RecognitionStatus (ByVal iRecogPage As Integer, ByVal iError As Integer)
MsgBox "The page # " + Str(iRecogPage) + "is finished its recognition" + Chr$(13) + _
"The recognition return code = " + Str(iError)
' continue to recognize next page
LEADRasterDoc.EnableStopRecognizeStatus = False
End Sub

6. | Run your program to test it.
7. | Save this project to use for testing other code samples.


Working with Recognition Results (Visual Basic)

Working with Recognition Results

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones.
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | GETOUTPUTFORMAT | Get Output Format
 | SAVEDOCUMENT | Save Document
3. | Code the GETOUTPUTFORMAT button's click procedure as follows:

Private Sub GETOUTPUTFORMAT_Click()
Dim nRet As Long
nRet = LEADRasterDoc.GetOutputFileFormats
If (nRet <> 0) Then
MsgBox "Error" + Str(nRet) + "in enumerating available file formats"
End If
End Sub

4.

Code the SAVEDOCUMENT button's click procedure as follows:

Private Sub SAVEDOCUMENT_Click()
Dim nRet As Long
nRet = LEADRasterDoc.GetRecognitionResultOptions
If (nRet = 0) Then
LEADRasterDoc.ResultOptions.FormatLevel = FORMATLEVEL_FULL
LEADRasterDoc.ResultOptions.DocumentOptions.PaperSizeMode = SELPREDEFINED
LEADRasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4
End If

LEADRasterDoc.SetRecognitionResultOptions
nRet = LEADRasterDoc.SaveDocument ("c:\test.doc")
If (nRet <> 0) Then
MsgBox "Error" + Str(nRet) + "in saving recognition result to a file"
End If
End Sub

5.

Code the EnumOutputFileFormats Event procedure as follows:

Private Sub LEADRasterDoc_EnumOutputFileFormats (ByVal Format As LTRASTERDOCLib.FORMATTYPE)
Dim nRet As Long

nRet = LEADRasterDoc.GetFileFormatInfo (Format)
If (nRet = 0) Then
MsgBox "Format Name = " + LEADRasterDoc.FileFormatInfo.FormatName + Chr$(13) + _
"Format DLL Name = " + LEADRasterDoc.FileFormatInfo.DLLName + Chr$(13) + _
"Format Ext Name = " + LEADRasterDoc.FileFormatInfo.ExtName

Select Case (LEADRasterDoc.FileFormatInfo.Type)
Case OUTTYPE_PLAIN
MsgBox "Format Type = Plain"

Case OUTTYPE_WORD_PROCESSOR
MsgBox "Format Type = Word Processor"

Case OUTTYPE_TRUE_WORD_PROCESSOR:
MsgBox "Format Type = True Word Processor"

Case OUTTYPE_TABLE
MsgBox "Format Type = Table"

Case OUTTYPE_UNKNOWN
MsgBox "Format Type = Unknown"

End Select

End If
End Sub

6. | Run your program to test it.
7. | Save this project to use for testing other code samples.


Painting Pages and Zones (Visual Basic)

Painting Pages and Zones

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | DRAWZONES | Draw Zones
 | DRAWPAGE | Draw Page
3. | Add the following code to the general declarations section of your project:

Dim bDrawPage As Boolean
Dim bDrawZones As Boolean
Add the following code to the main form's Load procedure
bDrawPage = False
bDrawZones = False

4.

Code the DRAWZONES button's click procedure as follows:

Private Sub DRAWZONES_Click()
bDrawZones = Not bDrawZones
End Sub

5.

Edit the ADDPAGE procedure, add the following lines after addpage:

bDrawPage = False
LEADRasterDoc.ActivePageIndex = 0
bDrawPage = True

6.

Code the DRAWPAGE button's click procedure as follows:

Private Sub DRAWPAGE_Click()
If (bDrawPage = True) Then
LEADRasterDoc.EnableShowZones = bDrawZones
LEADRasterDoc.DrawPersistence = False
LEADRasterDoc.DrawPageNull, hDC, 0
End If
End Sub

7.

Run your program to test it.


Miscellaneous Examples (Visual Basic)

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

AddPage Example for Visual Basic

AddZone Example for Visual Basic

AutoOrientPage Example for Visual Basic

CharacterOptions Example for Visual Basic

DefaultPageFillMethod Example for Visual Basic

DetectOrientationDegree Example for Visual Basic

EnableParallelRecognition Example for Visual Basic

EnableProgressStatusEvent Example for Visual Basic

EnableStopRecognizeStatus Example for Visual Basic

ExportPage Example for Visual Basic

ExportZones Example for Visual Basic

FindZones Example for Visual Basic

GetOutputFileFormats Example for Visual Basic

GetRecognizedCharacters Example for Visual Basic

GetRecognizedWords Example for Visual Basic

GetStatus Example for Visual Basic

GetZoneInfo Example for Visual Basic

IsCharacterEnabled Example for Visual Basic

MarkOptions Example for Visual Basic

MemoryRecognitionResultSize Example for Visual Basic

MOREnableFax Example for Visual Basic

OffsetZones Example for Visual Basic

PageWidth Example for Visual Basic

PaintZoomFactor Example for Visual Basic

ParagraphOptions Example for Visual Basic

RemoveItemFromUserDictionary Example for Visual Basic

RemovePage Example for Visual Basic

RemoveSelectedZone Example for Visual Basic

RemoveZone Example for Visual Basic

ResultOptions Example for Visual Basic

SelectLanguages Example for Visual Basic

SelectZoneByPoint Example for Visual Basic

SetHandPrintOptions Example for Visual Basic

SetOMROptions Example for Visual Basic

SetUserDictionary Example for Visual Basic

SpecialRejectedCharacter Example for Visual Basic

StartUp Example for Visual Basic

StopVerificationEvent Example for Visual Basic

UpdatePage Example for Visual Basic

UpdateZoneArea Example for Visual Basic

ZoneLeft Example for Visual Basic


AddPage Example for Visual Basic

Private Sub Command1_Click()
Dim nPageNumber As Long
Dim nPageCount As Long
Dim csBuffer As String
Dim nRet As Long

nPageNumber = 1
nRet = RasterDoc.AddPage (LEADRasterView1.Raster, nPageNumber)
If nRet = 0 Then
MsgBox ("The engine added a new page to the Document")
Else
MsgBox ("The engine could not add a new page to the Document")
End If

nPageCount = RasterDoc.PageCount
MsgBox "The Number of Pages in the Document is: " + Str(nPageCount)
End Sub


AddZone Example for Visual Basic

Private Sub Command6_Click()
Dim nZoneCount As Long
Dim csBuffer As String
Dim nRet As Long

Set ZoneData = New LTZoneData
ZoneData.Left = 100
ZoneData.Top = 100
ZoneData.Right = 200
ZoneData.Bottom = 200
ZoneData.FillMethod = FM_DEFAULT
ZoneData.RecognizeModule = RECOGNIZE_MODULE_AUTO
ZoneData.CharacterFilter = CHAR_FILTER_DEFAULT
ZoneData.Type = ZONE_TYPE_FLOWTEXT
ZoneData.Flags = 0
ZoneData.EnableVerificationEvent = False
ZoneData.SectionName = "cities"

nRet = RasterDoc.AddZone (0, 0, ZoneData)
If nRet = 0 Then
MsgBox "The engine added a new zone to the document successfully" + Chr$(13) + _
"The Added Zone ID = " + Str(ZoneData.ID)
Else
MsgBox ("The engine could not add a new zone to the document")
End If

nZoneCount = RasterDoc.ZoneCount (0)
MsgBox "Total zones in the specified page: " + Str(nZoneCount)

End Sub


AutoOrientPage Example for Visual Basic

Private Sub Command2_Click()
Dim nRet As Long

nRet = RasterDoc.AutoOrientPage(0)
If nRet <> 0 Then
MsgBox "Failure while auto orienting the current page"
End If
End Sub


CharacterOptions Example for Visual Basic

Private Sub Command34_Click()
RasterDoc.RecognitionResultOptions

' Update Character Options...
RasterDoc.ResultOptions.CharacterOptions.SelOutputFont = SELPREDEFINED
RasterDoc.ResultOptions.CharacterOptions.FontNames (0) = FONTPROPORTSERIF
RasterDoc.ResultOptions.CharacterOptions.FontNames (1) = FONTPREDEFFONT
RasterDoc.ResultOptions.CharacterOptions.FontNames (2) = FONTMONOSERIF
RasterDoc.ResultOptions.CharacterOptions.FontNames (3) = FONTPROPORTSANSSERIF
RasterDoc.ResultOptions.CharacterOptions.FontNames (4) = FONTMONOSANSSERIF
RasterDoc.ResultOptions.CharacterOptions.Size = 24
RasterDoc.ResultOptions.CharacterOptions.Bold = True
RasterDoc.ResultOptions.CharacterOptions.Italic = False
RasterDoc.ResultOptions.CharacterOptions.Underline = True

RasterDoc.SetRecognitionResultOptions
End Sub


DefaultPageFillMethod Example for Visual Basic

Private Sub Command7_Click()
Dim fm As Long
fm = RasterDoc.DefaultPageFillMethod (0)
If fm = FM_OMR Then
MsgBox "The Default Fill Method that used in the specified page is Fill OMR"
End If
End Sub


DetectOrientationDegree Example for Visual Basic

Private Sub TestDetectOrient()
Dim degree As Long

degree = RasterDoc.DetectOrientationDegree(0)
MsgBox "Orientation degree = " + CStr(degree)
End Sub


DefaultSpellLanguagesCount Example for Visual Basic

Private Sub Command15_Click()
Dim nLangCount As Long

nLangCount = RasterDoc.DefaultSpellLanguagesCount
MsgBox "Total Default Spell Languages = " + Str(nLangCount)

If nLangCount > 0 Then

If (RasterDoc.RecognizeModuleTradeoff <> RECOG_MODULE_ACCURATE) Then
RasterDoc.RecognizeModuleTradeoff = RECOG_MODULE_ACCURATE
End If

RasterDoc.EnableSubSystem = True
RasterDoc.EnableCorrection = True
RasterDoc.SpellLanguageID = RasterDoc.DefaultSpellLanguages (0)
RasterDoc.EnableFireRecognizeStatus = True
RasterDoc.EnableSaveResultsToMemory = True
RasterDoc.RecognitionDataFileName = "c:\test.rdf"

RasterDoc.Recognize 0, 1
End If
End Sub


DrawPage Example for Visual Basic

Private Sub Command26_Click()
RasterDoc.ActivePageIndex = 0
RasterDoc.EnableShowZones = True

RasterDoc.SelectedZonePenStyle = PENSTYLE_SOLID
RasterDoc.SelectedZonePenWidth = 3
RasterDoc.SelectedZonePenColor = RGB(255, 0, 0)

RasterDoc.SetSelectedZonePen

RasterDoc.ZonePenStyle = PENSTYLE_SOLID
RasterDoc.ZonePenWidth = 3
RasterDoc.ZonePenColor = RGB(0, 0, 0)

RasterDoc.SetZonePen

RasterDoc.ScaleMode = SCALEMODE_PIXEL

RasterDoc.SourceLeft = 0
RasterDoc.SourceTop = 0
RasterDoc.SourceWidth = RasterDoc.PageWidth (0)
RasterDoc.SourceHeight = RasterDoc.PageHeight (0)

RasterDoc.SourceClipLeft = 0
RasterDoc.SourceClipTop = 0
RasterDoc.SourceClipWidth = 0
RasterDoc.SourceClipHeight = 0

RasterDoc.DestinationLeft = 0
RasterDoc.DestinationTop = 0
RasterDoc.DestinationWidth = RasterDoc.PageWidth (0)
RasterDoc.DestinationHeight = RasterDoc.PageHeight (0)

RasterDoc.DestinationClipLeft = 0
RasterDoc.DestinationClipTop = 0
RasterDoc.DestinationClipWidth = 0
RasterDoc.DestinationClipHeight = 0

RasterDoc.DrawPersistence = False
RasterDoc.SelectZone Null, hDC, 0, 0, True
RasterDoc.DrawPage Null, hDC, 0
End Sub


EnableParallelRecognition Example for Visual Basic

Private Sub TestParallelRecognition()
If RasterDoc.EnableParallelRecognition = False Then
RasterDoc.EnableParallelRecognition = True
End If

MsgBox "The Parallel recognition mode is enabled."
End Sub


EnableProgressStatusEvent Example for Visual Basic

Private Sub RasterDoc_ProgressStatus(ByVal ID As LTRASTERDOCLib.OCR_PROCESS_ID, ByVal iPercent As Integer, ByVal iAcceptCharCount As Integer, ByVal iRejectCharCount As Integer, ByVal lObjSize As Long, ByVal bstrObjData As String)
RasterDoc.StopProgressStatusEvent = False
End Sub

Private Sub Command36_Click()
RasterDoc.EnableProgressStatusEvent = True
End Sub


EnableStopRecognizeStatus Example for Visual Basic

Private Sub RasterDoc_RecognitionStatus (ByVal iRecogPage As Integer, ByVal iError As Integer)
Dim strBuffer As String

strBuffer = "Recognized page index = " + CStr(iRecogPage) + Chr$(13) + _
"Recognition Return value = " + CStr(iError)
MsgBox strBuffer
RasterDoc.EnableStopRecognizeStatus = False
End Sub

Private Sub Command15_Click()
Dim nLangCount As Long

nLangCount = RasterDoc.DefaultSpellLanguagesCount
MsgBox "Totat Default Spell Languages = " + Str(nLangCount)

If nLangCount > 0 Then

If (RasterDoc.RecognizeModuleTradeoff <> RECOG_MODULE_ACCURATE) Then
RasterDoc.RecognizeModuleTradeoff = RECOG_MODULE_ACCURATE
End If

RasterDoc.EnableSubSystem = True
RasterDoc.EnableCorrection = True
RasterDoc.SpellLanguageID = RasterDoc.DefaultSpellLanguages (0)
RasterDoc.EnableFireRecognizeStatus = True
RasterDoc.EnableSaveResultsToMemory = True
RasterDoc.RecognitionDataFileName = "c:\test.rdf"

RasterDoc.Recognize 0, 1
End If
End Sub


ExportPage Example for Visual Basic

Private Sub Command3_Click()
Dim nRet As Long

nRet = RasterDoc.ExportPage (LEADRasterView1.Raster, 0)
If nRet = 0 Then
MsgBox "The engine exported the specified page"
Else
MsgBox "The engine couldn't export the specified page"
End If
End Sub


ExportZones Example for Visual Basic

Private Sub Command12_Click()
Dim nRet As Integer
nRet = RasterDoc.ImportZones (0, "c:\\zone.zon")
If nRet = 0 Then
MsgBox "Imports the zone file into the specified page"
End If

'...
' work with zones...
'...

' exports page zone list to Zone file...
nRet = RasterDoc.ExportZones (0, "c:\\zone.zon")
If nRet = 0 Then
MsgBox ("Exports the zone list into a zone file")
End If
End Sub


FindZones Example for Visual Basic

Private Sub Command9_Click()
Dim nRet As Integer

RasterDoc.GetAutoZoneOptions
RasterDoc.ShowZoneGridLines = True
RasterDoc.EnableZoneForceSingleColumn = True
RasterDoc.ZoneParser = PARSER_AUTO

RasterDoc.SetAutoZoneOptions

nRet = RasterDoc.FindZones (0, True)
If nRet = 0 Then
MsgBox "The engine finds all available zones in the specified page"
End If
End Sub


GetOutputFileFormats Example for Visual Basic

Private Sub RasterDoc_EnumOutputFileFormats (ByVal Format As LTRASTERDOCLib.FORMATTYPE)
If Format = DOCRTF_WORD_2000 Then
RasterDoc.GetFileFormatInfo DOCRTF_WORD_2000

MsgBox "Format Name = " + RasterDoc.FileFormatInfo.FormatName + Chr$(13) + _
"nFormat DLL Name = " + RasterDoc.FileFormatInfo.DLLName + Chr$(13) + _
"Format Ext = " + RasterDoc.FileFormatInfo.ExtName + Chr$(13) + _
"Format Type = " + Str(RasterDoc.FileFormatInfo.Type) + Chr$(13)
End If
End Sub

Private Sub Command22_Click()
RasterDoc.GetOutputFileFormats
End Sub


GetRecognizedCharacters Example for Visual Basic

Private Sub Command25_Click()
Dim nRet As Integer
Dim i As Integer
Dim iFont As Integer

RasterDoc.SpellLanguageID = LANGID_ENGLISH
RasterDoc.EnableSaveResultsToMemory = False
RasterDoc.RecognitionDataFileName = "c:\test.rdf"

nRet = RasterDoc.Recognize (0, 0)
If (nRet = 0) Then
'Dim lDocumentOptions As New LTDocumentOptions
Dim nCharsCount As Long

RasterDoc.GetRecognizedCharacters (0)
nCharsCount = RasterDoc.RecognizedCharactersCount

For i = 0 To i = nCharsCount - 1
If (RasterDoc.RecognizedCharacter (i).Confidence > 900) Then
iFont = RasterDoc.RecognizedCharacter (i).Font

iFont = iFont + FONT_BOLD + FONT_UNDERLINE
RasterDoc.RecognizedCharacter(i).Font = iFont
RasterDoc.RecognizedCharacter(i).FontSize = 20

If (RasterDoc.RecognizedCharacter(i).Flags And CHAR_ENDOFWORD = CHAR_ENDOFWORD) Then
MsgBox "Last Character in the word is available at the following position" + Chr$(13) + _
"Left = " + Str(RasterDoc.RecognizedCharacter(i).Left) + Chr$(13) + _
"Top = " + Str(RasterDoc.RecognizedCharacter(i).Top) + Chr$(13) + _
"Width = " + Str(RasterDoc.RecognizedCharacter(i).Width) + Chr$(13) + _
"Height = " + Str(RasterDoc.RecognizedCharacter(i).Height) + Chr$(13) + _
"YOffset = " + Str(RasterDoc.RecognizedCharacter(i).YOffset)

MsgBox "First guess char = " + RasterDoc.RecognizedCharacter(i).GuessCode + Chr$(13) + _
"Second guess char = " + RasterDoc.RecognizedCharacter(i).GuessCode2 + Chr$(13) + _
"Third guess char = " + RasterDoc.RecognizedCharacter(i).GuessCode3

MsgBox "First Language Id = " + Str(RasterDoc.RecognizedCharacter(i).LanguageId) + Chr$(13) + _
"Second Language Id = " + Str(RasterDoc.RecognizedCharacter(i).LanguageId2) + Chr$(13) + _
"Zone Index = " + Str(RasterDoc.RecognizedCharacter(i).ZoneIndex) + Chr$(13) + _
"Cell Index = " + Str(RasterDoc.RecognizedCharacter(i).CellIndex) + Chr$(13) + _
"Space = " + Str(RasterDoc.RecognizedCharacter(i).Space) + Chr$(13) + _
"Space Error = " + Str(RasterDoc.RecognizedCharacter(i).SpaceErr)

End If
End If
Next i

RasterDoc.SetRecognizedCharacters (0)
RasterDoc.GetRecognitionResultOptions

RasterDoc.ResultOptions.Format = DOCRTF_WORD_2000
RasterDoc.GetResultOptions.FormatLevel = FORMATLEVEL_FULL

RasterDoc.ResultOptions.DocumentOptions.PaperSizeMode = SELPREDEFINED
RasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4
RasterDoc.ResultOptions.DocumentOptions.PaperOrientation = PAPER_ORIENT_PORTRAIT
RasterDoc.ResultOptions.DocumentOptions.Color = COL_ORIGINAL
RasterDoc.ResultOptions.DocumentOptions.EnableTextInBoxes = False
RasterDoc.ResultOptions.DocumentOptions.MarginLeft = 5
RasterDoc.ResultOptions.DocumentOptions.MarginTop = 5
RasterDoc.ResultOptions.DocumentOptions.MarginWidth = 200
RasterDoc.ResultOptions.DocumentOptions.MarginHeight = 200
RasterDoc.ResultOptions.DocumentOptions.EnablePageBreaks = True
RasterDoc.ResultOptions.DocumentOptions.TableMethod = TM_USETABS

RasterDoc.SetRecognitionResultOptions
RasterDoc.SaveDocument ("c:\\test.doc")
End If
End Sub


GetRecognizedWords Example for Visual Basic

void CSample_COMDlg::TestGetRecognizedWords()
{
CString csBuffer;

pRasterDoc->GetRecognizedWords(0);
int nWordsCount = pRasterDoc->RecognizedWordsCount;
for(int i=0; i<nWordsCount; i++)
{
BSTR bstrWord = pRasterDoc->RecognizedWord[i];
CString csWord = bstrWord;

csBuffer.Format(TEXT("Word = %s\nZone Index = %d\nArea {%d, %d, %d, %d}"),
csWord,
pRasterDoc->RecognizedWordZone[i],
pRasterDoc->RecognizedWordLeft[i],
pRasterDoc->RecognizedWordTop[i],
pRasterDoc->RecognizedWordWidth[i] + pRasterDoc->RecognizedWordLeft[i],
pRasterDoc->RecognizedWordHeight[i] + pRasterDoc->RecognizedWordTop[i]);
AfxMessageBox(csBuffer);
}
}


GetStatus Example for Visual Basic

Private Sub Command19_Click()
RasterDoc.GetStatus

MsgBox "Recognized Characters = " + Str(RasterDoc.RecognizeStatus.RecognizedCharacterCount) + chr$(13) + _
"Recognized Words = " + Str(RasterDoc.RecognizeStatus.RecognizedWordCount) + Chr$(13) + _
"Rejected Characters = " + Str(RasterDoc.RecognizeStatus.RejectCharacterCount) + Chr$(13) + _
"Rejected Words = " + Str(RasterDoc.RecognizeStatus.RejectWordCount) + Chr$(13) + _
"Recognized Time = " + Str(RasterDoc.RecognizeStatus.RecognizedTime) + Chr$(13) + _
"Reading Time = " + Str(RasterDoc.RecognizeStatus.ReadingTime) + Chr$(13) + _
"Pre Process time = " + Str(RasterDoc.RecognizeStatus.PreProcessTime) + Chr$(13) + _
"Decomposition = " + Str(RasterDoc.RecognizeStatus.DecompositionTime)
End Sub


GetUserDictionarySection Example for Visual Basic

Private Sub Command31_Click()
Dim bState As Boolean
Dim strSection As String
Dim strSectionItem As String

MsgBox "User Dictionray Name = " + RasterDoc.DictionaryFileName + Chr$(13) + _
"Default Section Name = " + RasterDoc.DictionaryDefaultSection

bState = RasterDoc.DictionaryState

If bState = True Then 'Make sure that the True vaue is 1
MsgBox ("The current user dictionary is changed")
Else
MsgBox ("The current user dictionary is not changed")
End If

strSection = RasterDoc.GetUserDictionarySection (SECTION_NAME_LENGTH, True)
MsgBox "First Section in the current User Dictionray = " + strSection

strSectionItem = RasterDoc.GetUserDictionarySectionItem (strSection, 512, True)
MsgBox "1st Section Item in the 1st section of the current User Dictionray = " + strSectionItem
End Sub


GetZoneInfo Example for Visual Basic

Private Sub Command8_Click()
Dim ZoneData As New LTZoneData
Dim nRet As Long

nRet = RasterDoc.GetZoneInfo (0, 0, ZoneData)
If nRet = 0 Then
MsgBox "The engine retrieved the specified zone information successfully"

ZoneData.FillMethod = FM_OCRA
ZoneData.Type = ZONE_TYPE_GRAPHIC

nRet = RasterDoc.UpdateZone (0, 0, ZoneData)
If nRet = 0 Then
MsgBox "The specified zone is updated"
End If
End If
End Sub


IsCharacterEnabled Example for Visual Basic

Private Sub Command14_Click()
Dim i As Long
Dim nRet As Integer

MsgBox "Total Select Languages = " + Str(RasterDoc.SelectedLanguagesCount)

For i = 0 To RasterDoc.SelectedLanguagesCount - 1
If RasterDoc.SelectedLanguages (i) = LANGID_ENGLISH Then
MsgBox ("English is active language")
End If
Next i

nRet = RasterDoc.IsCharacterEnabled ("a")
If nRet = True Then
MsgBox ("The specified character is available in the selected langauges")
Else
MsgBox ("The specified character is not available in the selected langauges")
End If
End Sub


MarkOptions Example for Visual Basic

Private Sub Command35_Click()
RasterDoc.RecognitionResultOptions

RasterDoc.ResultOptions.MarkOptions.ColorSuspectCharacter = COL_BW
RasterDoc.ResultOptions.MarkOptions.ColRejectionSymbol = COL_BW + COL_GRAY
RasterDoc.ResultOptions.MarkOptions.ColMissingSymbol = COL_NONEGR
RasterDoc.ResultOptions.MarkOptions.ColSuspectWord = COL_ORIGINAL

RasterDoc.SetRecognitionResultOptions

MsgBox "Separator Before Suspect Character = " + RasterDoc.ResultOptions.MarkOptions.SeparatorBeforeSuspectCharacter + Chr$(13) + _
"Separator Before Rejection Symbol = " + RasterDoc.ResultOptions.MarkOptions.SeparatorBeforeRejectionSymbol + Chr$(13) + _
"Separator Before Missing Symbol = " + RasterDoc.ResultOptions.MarkOptions.SeparatorBeforeMissingSymbol + Chr$(13) + _
"Separator Start Suspect Word = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartSuspectWord + Chr$(13) + _
"Separator End Suspect Word = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndSuspectWord + Chr$(13) + _
"Separator Start Line = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartLine + Chr$(13) + _
"Separator End Line = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndLine + Chr$(13) + _
"Separator Start Table Row = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartTableRow + Chr$(13) + _
"Separator End Table Row = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndTableRow + Chr$(13) + _
"Separator Start Paragraph = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartParagraph + Chr$(13) + _
"Separator End Paragraph = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndParagraph + Chr$(13) + _
"Separator Start Zone = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartZone + Chr$(13) + _
"Separator End Zone = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndZone + Chr$(13) + _
"Separator Start Page = " + RasterDoc.ResultOptions.MarkOptions.SeparatorStartPage + Chr$(13) + _
"Separator End Page = " + RasterDoc.ResultOptions.MarkOptions.SeparatorEndPage

End Sub


MemoryRecognitionResultSize Example for Visual Basic

Private Sub Command20_Click()
Dim nRet As Integer

RasterDoc.EnableSaveResultsToMemory = True
RasterDoc.RecognitionDataFileName = "c:\test.rdf"
RasterDoc.SpellLanguageID = LANGID_ENGLISH
nRet = RasterDoc.Recognize (0, 1)

If nRet = 0 Then
nRet = RasterDoc.SaveResultsToMemory
If (nRet = 0) Then
MsgBox "Recognition Result Size =" + Str(RasterDoc.MemoryRecognitionResultSize)
MsgBox "Recognition Result = " + RasterDoc.MemoryRecognitionResult
Else
MsgBox "Failed to save results to memory"
End If
End If
End Sub


MOREnableFax Example for Visual Basic

Private Sub Command16_Click()
If RasterDoc.MOREnableFax = False Then
RasterDoc.MOREnableFax = True
End If
End Sub


OffsetZones Example for Visual Basic

Private Sub Command27_Click()
Dim nRet As Integer
RasterDoc.DrawPersistence = False
RasterDoc.OffsetZones(0, 0)
nRet = RasterDoc.SelectZoneByPoint (Null, hDC, 0, 100, 100)
If nRet = 0 Then
MsgBox "The selected zone index = " + Str(RasterDoc.SelectZoneIndex)
End If
End Sub


PageWidth Example for Visual Basic

Private Sub Command4_Click()
Dim csBuffer As String
Dim nBitsPerPixel As Long
Dim nPageWidth As Long
Dim nPageHeight As Long

nBitsPerPixel = RasterDoc.PageBitsPerPixel (0)
nPageWidth = RasterDoc.PageWidth (0)
nPageHeight = RasterDoc.PageHeight (0)

MsgBox "Page Width = " + Str(nPageWidth) + Chr$(13) + _
"Page Height = " + Str(nPageHeight) + Chr$(13) + _
"nPage Bits Per Pixel = " + Str(nBitsPerPixel)
End Sub


PaintZoomFactor Example for Visual Basic

Private Sub TestPaintZoomFactor()
RasterDoc.ActivePageIndex = 0
RasterDoc.EnableShowZones = True

RasterDoc.PutScaleMode SCALEMODE_PIXEL

RasterDoc.SourceLeft = 0
RasterDoc.SourceTop = 0
RasterDoc.SourceWidth = RasterDoc.PageWidth(0)
RasterDoc.SourceHeight = RasterDoc.PageHeight (0)

RasterDoc.SourceClipLeft = 0
RasterDoc.SourceClipTop = 0
RasterDoc.SourceClipWidth = 0
RasterDoc.SourceClipHeight = 0

RasterDoc.DestinationLeft = 0
RasterDoc.DestinationTop = 0
RasterDoc.DestinationWidth = RasterDoc.PageWidth(0)
RasterDoc.DestinationHeight = RasterDoc.PageHeight (0)

RasterDoc.DestinationClipLeft = 0
RasterDoc.DestinationClipTop = 0
RasterDoc.DestinationClipWidth = 0
RasterDoc.DestinationClipHeight = 0

If RasterDoc.PaintZoomFactor(0) <> 100# Then
RasterDoc.PaintZoomFactor(0) = 100#
End If

RasterDoc.DrawPersistence = False
RasterDoc.DrawPage Null, Me.hDC, 0
End Sub


ParagraphOptions Example for Visual Basic

Private Sub Command33_Click()
RasterDoc.RecognitionResultOptions

' Update Paragraph Options....
RasterDoc.ResultOptions.ParagraphOptions.SpaceBeforeMode = SELPREDEFINED
RasterDoc.ResultOptions.ParagraphOptions.SpaceBefore = 2
RasterDoc.ResultOptions.ParagraphOptions.ParagraphIndentMode = SELPREDEFINED
RasterDoc.ResultOptions.ParagraphOptions.FirstLineIndent = 2
RasterDoc.ResultOptions.ParagraphOptions.LineSpacingMode = SELPREDEFINED
RasterDoc.ResultOptions.ParagraphOptions.LineSpacing = LINE_SPACE_ONE
RasterDoc.ResultOptions.ParagraphOptions.AlignmentMode = SELPREDEFINED
RasterDoc.ResultOptions.ParagraphOptions.Alignment = ALIGN_LEFT

RasterDoc.SetRecognitionResultOptions
End Sub


RemoveItemFromUserDictionary Example for Visual Basic

Private Sub Command32_Click()
Dim nRet As Integer

nRet = RasterDoc.RemoveItemFromUserDictionary ("cities", "Peabody")
If (nRet = 0) Then
RasterDoc.DictionaryFileName = "USERDIC1.DIC"
RasterDoc.DictionaryDefaultSection = "cities"
RasterDoc.SetUserDictionary (False)
End If
End Sub


RemovePage Example for Visual Basic

Private Sub Command5_Click()
Dim nRet As Integer

nRet = RasterDoc.RemovePage (0)
If nRet = 0 Then
MsgBox "The engine deleted the specified page from the OCR document"
Else
MsgBox "The engine could not delete the specified page from the OCR document"
End If

End Sub


RemoveSelectedZone Example for Visual Basic

Private Sub Command28_Click()
Dim nRet As Integer
nRet = RasterDoc.RemoveSelectedZone (0)
If nRet = 0 Then
MsgBox ("The selected zone is deleted from Zone list in the page")
Else
MsgBox ("Can't delete the selected zone or there is no selected zone")
End If
End Sub


RemoveZone Example for Visual Basic

Private Sub Command11_Click()
Dim nRet As Integer
nRet = RasterDoc.RemoveZone (0, 0)
If nRet = 0 Then
MsgBox ("The specified zone is deleted from the specified page")
Else
MsgBox ("The engine couldn't delete the specified zone")
End If
End Sub


ResultOptions Example for Visual Basic

Private Sub Command21_Click()
Dim nRet As Integer
RasterDoc.EnableSaveResultsToMemory = False
RasterDoc.RecognitionDataFileName = "c:\test.rdf"
RasterDoc.SpellLanguageID = LANGID_ENGLISH

nRet = RasterDoc.Recognize (0, 1)
If nRet = 0 Then
RasterDoc.GetRecognitionResultOptions

RasterDoc.ResultOptions.Format = DOCRTF_WORD_2000
RasterDoc.ResultOptions.FormatLevel = FORMATLEVEL_FULL

RasterDoc.ResultOptions.DocumentOptions.PaperSizeMode = SELPREDEFINED
RasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4
RasterDoc.ResultOptions.DocumentOptions.MarginsMode = SELAUTO
RasterDoc.ResultOptions.DocumentOptions.LanguageMode = SELAUTO
RasterDoc.ResultOptions.DocumentOptions.ResultLanguage = LANGOUT_ENGLISH_US

RasterDoc.SetRecognitionResultOptions
nRet = RasterDoc.SaveDocument ("c:\\test.doc")
If (nRet = 0) Then
MsgBox ("The recognition results saved to a file")
End If
End If
End Sub


SelectLanguages Example for Visual Basic

Private Sub Command13_Click()
Dim nRet As Integer

RasterDoc.ActiveLanguagesCount = 1
RasterDoc.ActiveLanguage (0) = LANGID_ENGLISH

nRet = RasterDoc.SelectLanguages
If nRet <> 0 Then
MsgBox "Couldn't set the English as default language"
End If

RasterDoc.LanguageCharacterPlus = "Test Plus"
RasterDoc.LanguageCharacterPlusFilter = "Test Plus Filter"

If RasterDoc.LanguageCharacterFilter <> CHAR_FILTER_ALL Then
RasterDoc.LanguageCharacterFilter = CHAR_FILTER_ALL
End If
End Sub


SelectZoneByPoint Example for Visual Basic

Private Sub Command27_Click()
Dim nRet As Integer
RasterDoc.DrawPersistence = False
nRet = RasterDoc.SelectZoneByPoint (Null, hDC, 0, 100, 100)
If nRet = 0 Then
MsgBox "The selected zone index = " + Str(RasterDoc.SelectZoneIndex)
End If
End Sub


SetHandPrintOptions Example for Visual Basic

Private Sub Command17_Click()
RasterDoc.GetHandPrintOptions

If RasterDoc.HandPrintModuleOptions.Style <> HANDSTYLE_US Then
RasterDoc.HandPrintModuleOptions.Style = HANDSTYLE_US
End If

RasterDoc.HandPrintModuleOptions.EnableSpace = False
RasterDoc.HandPrintModuleOptions.CharacterHeight = 6
RasterDoc.HandPrintModuleOptions.CharacterWidth = 4
RasterDoc.HandPrintModuleOptions.CharacterSpace = 1

RasterDoc.SetHandPrintOptions
End Sub


SetOMROptions Example for Visual Basic

Private Sub Command18_Click()
RasterDoc.GetOMROptions

If RasterDoc.OMRModuleOptions.EnableFill = False Then
RasterDoc.OMRModuleOptions.EnableFill = True
End If

If RasterDoc.OMRModuleOptions.Frame <> OMRFRAME_YES Then
RasterDoc.OMRModuleOptions.Frame = OMRFRAME_YES
End If

If RasterDoc.OMRModuleOptions.Sense <> OMRSENSE_NORMAL Then
RasterDoc.OMRModuleOptions.Sense = OMRSENSE_NORMAL
End If

RasterDoc.SetOMROptions
End Sub


SetUserDictionary Example for Visual Basic

Private Sub Command30_Click()
Dim nRet As Integer
nRet = RasterDoc.SetUserDictionary (True)
If (nRet = 0) Then
RasterDoc.AddItemToUserDictionary "cities", "Peabody"
RasterDoc.AddItemToUserDictionary "cities", "Budapest"

RasterDoc.DictionaryFileName = "USERDIC1.DIC"
RasterDoc.DictionaryDefaultSection = "cities"
RasterDoc.DictionaryItemAttribute = USER_DICT_LITERAL

nRet = RasterDoc.SetUserDictionary (False)
If nRet = 0 Then
MsgBox ("The user dictionary is saved into file")
End If
End If
End Sub


SpecialRejectedCharacter Example for Visual Basic

Private Sub Command23_Click()
Dim nRet As Integer
RasterDoc.EnableSaveResultsToMemory = False
RasterDoc.RecognitionDataFileName = "c:\test.rdf"
RasterDoc.SpellLanguageID = LANGID_ENGLISH

nRet = RasterDoc.Recognize (0, 1)
If (nRet = 0) Then
If (RasterDoc.SpecialMissingSymbol = "^") Then
RasterDoc.SpecialMissingSymbol = "^"
End If

If RasterDoc.SpecialRejectedCharacter = "!" Then
RasterDoc.SpecialRejectedCharacter = "!"
End If
End If

' //...
' //... save recognition results using SaveDocument
' //...

RasterDoc.SaveDocument "C:\Ocr1.ocr"
End Sub


StartUP Example for Visual Basic

Dim WithEvents RasterDoc As LEADRasterDocument

Private Sub Command37_Click()
Dim nRet As Integer
Set RasterDoc = New LEADRasterDocument

' Unlock OCR support.
' Note that this is a sample key, which will not work in your toolkit.
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_OCR, "TestKey"
nRet = RasterDoc.StartUp
If (nRet = 0) Then
RasterDoc.EnableMethodErrors = False
RasterDoc.LoadSettingsFile "c:\OCRsetting.set"

If RasterDoc.PageFillMethod <> FM_HANDPRINT Then
RasterDoc.PageFillMethod = FM_HANDPRINT
End If

nRet = RasterDoc.SaveSettingsFile ("c:\OCRsetting.set")
If nRet = 0 Then
MsgBox "The engine saved the updated settings to a file"
Else
MsgBox "The engine couldn't save the updated settings to a file"
End If

RasterDoc.ShutDown
End If
Set RasterDoc = Nothing
End Sub


StopVerificationEvent Example for Visual Basic

Private Sub ZoneData_Verification (ByVal iZoneIndex As Integer, ByVal bstrWord As String)
'...
'... Set your code here
'...
ZoneData.VerifyCode = VF_ACCEPT
RasterDoc.StopVerificationEvent = False
End Sub

Private Sub Command6_Click()
Dim nZoneCount As Long
Dim csBuffer As String
Dim nRet As Long

Set ZoneData = New LTZoneData
ZoneData.Left = 100
ZoneData.Top = 100
ZoneData.Right = 200
ZoneData.Bottom = 200
ZoneData.FillMethod = FM_DEFAULT
ZoneData.RecognizeModule = RECOGNIZE_MODULE_AUTO
ZoneData.CharacterFilter = CHAR_FILTER_DEFAULT
ZoneData.Type = ZONE_TYPE_FLOWTEXT
ZoneData.Flags = 0
ZoneData.EnableVerificationEvent = True
ZoneData.SectionName = "cities"

nRet = RasterDoc.AddZone (0, 0, ZoneData)
If nRet = 0 Then
MsgBox "The engine added a new zone to the document successfully" + Chr$(13) + _
"The Added Zone ID = " + Str(ZoneData.ID)
Else
MsgBox ("The engine could not add a new zone to the document")
End If

nZoneCount = RasterDoc.ZoneCount (0)
MsgBox "Total zones in the specified page: " + Str(nZoneCount)

End Sub


UpdatePage Example for Visual Basic

Private Sub Command2_Click()
Dim nRet As Long

nRet = RasterDoc.UpdatePage (LEADRasterView1.Raster, 0)
If nRet = 0 Then
MsgBox "The engine successfully updated the Page"
Else
MsgBox "The engine could not Update the page"
End If
End Sub


UpdateZoneArea Example for Visual Basic

Private Sub Command29_Click()
Dim nRet As Integer
Dim fLeft As Double
Dim fTop As Double
Dim fRight As Double
Dim fBottom As Double

RasterDoc.DrawPersistence = False
nRet = RasterDoc.SelectZoneByPoint (Null, hDC, 0, 100, 100)
If nRet = 0 Then
fLeft = RasterDoc.SelectedZone (0).Left
fTop = RasterDoc.SelectedZone (0).Top
fRight = RasterDoc.SelectedZone (0).Right
fBottom = RasterDoc.SelectedZone (0).Bottom

nRet = RasterDoc.UpdateZoneArea (0, RasterDoc.SelectZoneIndex, fLeft + 10, fTop + 10, fRight + fLeft + 50, fBottom + fTop + 50)
If (nRet = 0) Then
MsgBox ("The selected zone area is updated")
End If
End If
End Sub


ZoneLeft Example for Visual Basic

Private Sub Command10_Click()
Dim nRet As Integer
RasterDoc.ZoneLeft = 100
RasterDoc.ZoneTop = 100
RasterDoc.ZoneWidth = 250
RasterDoc.ZoneHeight = 250

nRet = RasterDoc.FindZones (0, False)
If nRet = 0 Then
MsgBox "The engine finds all available zones in the specified page"
End If
End Sub


Tutorial for Visual Basic Script Programmers

The following topics provide brief and simple examples to help you learn how to use the LEAD OCR Object Library.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax .

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Pages

Working with Recognition Results


Working with Pages (Visual Basic Script)

Copy and paste the following code into an HTML file to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnUnload()
LEADRasterDoc.ShutDown
End Sub

Sub SetActiveLangs()
Dim nRet
Dim LANGID_ENGLISH

LANGID_ENGLISH = 0
LEADRasterDoc.ActiveLanguagesCount = 1
LEADRasterDoc.ActiveLanguage(0) = LANGID_ENGLISH
nRet = LEADRasterDoc.SelectLanguages()
If (nRet <> 0) Then
MsgBox "Error " + CStr(nRet) + "Setting English as default language"
Else
MsgBox "English is Set as the active language"
End If
End Sub

Sub AddPage()
Dim L_SUPPORT_OCR
L_SUPPORT_OCR = 3

LEADRaster.UnlockSupport L_SUPPORT_OCR, "OCR Key Goes Here"
LEADRasterDoc.StartUp

Dim nPageNumber
Dim nRet

nRet = LEADRasterIO.Load (LEADRaster, "D:\Ocr\LETTER.TIF", 0, 0, 1)
If (nRet <> 0) Then
MsgBox "Error loading file"
End If

nRet = LEADRasterDoc.AddPage(LEADRaster, nPageNumber)
If (nRet = 0) Then
MsgBox "Page Width = " + CStr(LEADRasterDoc.PageWidth(nPageNumber)) + Chr(13) + "Page Height = " + CStr(LEADRasterDoc.PageHeight(nPageNumber)) + Chr(13) + "Page Bits Per Pixel = " + CStr(CStr(LEADRasterDoc.PageBitsPerPixel(nPageNumber)))
Else
MsgBox "The engine could not add a new page to the Document"
End If

SetActiveLangs
End Sub

Sub RemovePage()
Dim nRet
Dim nPageCount
Dim i

nPageCount = LEADRasterDoc.PageCount
For i = 0 To nPageCount - 1
nRet = LEADRasterDoc.RemovePage(i)
If (nRet = 0) Then
MsgBox "The page # " + CStr(i) + "is removed successfully"
End If
Next
End Sub

Sub FlipPage()
Dim nRet

nRet = LEADRasterDoc.ExportPage(LEADRaster, 0)
LEADRasterProc.Flip LEADRaster
nRet = LEADRasterDoc.UpdatePage(LEADRaster, 0)
If (nRet = 0) Then
MsgBox "The specified page is updated successfuly"
Else
MsgBox "Error " + CStr(nRet) + " in updating page bitmap for page # 0"
LEADRasterDoc.ActivePageIndex = 0
End If
End Sub
//-->
</SCRIPT>

<TITLE>LEADTOOLS VBScript COM OCR Example</TITLE>

</HEAD>

<BODY OnUnload="Window_OnUnload">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1" ID="Object1" >
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<object classid="clsid:00140700-B1BA-11CE-ABC6-F5B2E79D9E3F" ID="LeadRaster" >
</object>

<OBJECT ID="RasterIO" NAME="LEADRasterIO"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab" >
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<object classid="clsid:00140B30-B1BA-11CE-ABC6-F5B2E79D9E3F"
ID="LEADRasterDoc" >
</object>

<OBJECT ID="LEADRasterProc" NAME="LEADRasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab" >
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm" ID="Form1">
<INPUT TYPE="button" VALUE="Add Page" LANGUAGE="VBScript"
OnClick="AddPage" ID="Button1">

<INPUT TYPE="button" VALUE="Remove Page" LANGUAGE="VBScript"
OnClick="RemovePage" ID="Button2">

<INPUT TYPE="button" VALUE="Flip Page" LANGUAGE="VBScript"
OnClick="FlipPage" ID="Button3">
</FORM>
</BODY>
</HTML>


Working with Zones (Visual Basic Script)

Take the following steps to add code to the existing page that will let you manipulate zones:

1. | Start with the program you created in Working with Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Find Zones" LANGUAGE="VBScript"
OnClick="FindZones" ID="Button4">

<INPUT TYPE="button" VALUE="Zones Count" LANGUAGE="VBScript"
OnClick="ZonesCount" ID="Button5">

<INPUT TYPE="button" VALUE="Verify Zone" LANGUAGE="VBScript"
OnClick="VerifyZone" ID="Button6">

3.

Add the following code to add an instance of the LTZoneData class:

<object classid="clsid:00140B4A-B1BA-11CE-ABC6-F5B2E79D9E3F">
</object>

4.

Add the following code between the <SCRIPT> and /SCRIPT> tags:

Sub FindZones()
Dim nRet
LEADRasterDoc.GetAutoZoneOptions
LEADRasterDoc.EnableZoneForceSingleColumn = True
LEADRasterDoc.ShowZoneGridLines = True

LEADRasterDoc.SetAutoZoneOptions
nRet = LEADRasterDoc.FindZones(0, True)
If (nRet = 0) Then
MsgBox "Automatic zones method finds all available zones into the specified pages successfully"
Else
MsgBox "Error" + CStr(nRet) + "in finding available zone in the specified page"
End If
End Sub

Sub ZonesCount()
Dim nZoneCount
nZoneCount = LEADRasterDoc.ZoneCount(0)
MsgBox "Total Zones count = " + CStr(nZoneCount)
End Sub

Sub VerifyZone()
Dim nZoneCount
Dim nRet
Dim i
Dim ZONE_CHK_CHECKCBF_PROHIBIT

ZONE_CHK_CHECKCBF_PROHIBIT = 4

nZoneCount = LEADRasterDoc.ZoneCount(0)
For i = 0 To nZoneCount -1
nRet = LEADRasterDoc.GetZoneInfo(0, i, ZoneData)
If (nRet = 0) Then
If ((ZoneData.Flags And ZONE_CHK_CHECKCBF_PROHIBIT) = ZONE_CHK_CHECKCBF_PROHIBIT) Then
ZoneData.Flags = ZoneData.Flags And (Not ZONE_CHK_CHECKCBF_PROHIBIT)
End If

ZoneData.EnableVerificationEvent = True
nRet = LEADRasterDoc.UpdateZone(0, i, ZoneData)

If (nRet <> 0) Then
MsgBox "Error" + CStr(nRet) + "in updating zone # " + CStr(i)
End If
End If
Next
End Sub

5.

Add the following code between the <HEAD> and </HEAD> tags to handle the Verification event:

<SCRIPT LANGUAGE="VBScript" FOR="ZoneData" EVENT="Verification(iZoneIndex, bstrWord)">
<!--
Dim VF_ACCEPT
VF_ACCEPT = 4

ZoneData.VerifyCode = VF_ACCEPT
ZoneData.StopVerificationEvent = False
MsgBox bstrWord
//-->
</SCRIPT>

6. | Run your page to test it.
7. | Save this page to use for testing other code samples.


Recognizing Pages (Visual Basic Script)

Take the following steps to add code to the existing page that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Recognize" LANGUAGE="VBScript"
OnClick="Recognize" ID="Button7" NAME="Button7">

<INPUT TYPE="button" VALUE="Get Status" LANGUAGE="VBScript"
OnClick="GetStatus" ID="Button8" NAME="Button8">

3.

Add the following code between the <SCRIPT> and </SCRIPT> tags:

Sub Recognize()
Dim nRet
Dim LANGID_ENGLISH

LANGID_ENGLISH = 0
LEADRasterDoc.SpellLanguageID = LANGID_ENGLISH
LEADRasterDoc.EnableSubSystem = True
LEADRasterDoc.EnableCorrection = True

LEADRasterDoc.RecognitionDataFileName = "D:\Ocr\LETTER.TIF"

nRet = LEADRasterDoc.Recognize(0, 1)
If (nRet = 0) Then
MsgBox "The engine finished recognizing the specified pages successfully"
Else
MsgBox "Error" + CStr(nRet) + "in recognized specified pages"
End If
End Sub

Sub GetStatus()
Dim nRet
nRet = LEADRasterDoc.GetStatus()
If (nRet = 0) Then
MsgBox "Recognition Time = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedTime) + Chr(13) + _
"Total Recognized Characters = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedCharacterCount) + Chr(13) + _
"Total Recognized Words = " + CStr(LEADRasterDoc.RecognizeStatus.RecognizedWordCount) + Chr(13) + _
"Total Rejected Characters = " + CStr(LEADRasterDoc.RecognizeStatus.RejectCharacterCount) + Chr(13) + _
"Total Rejected Words = " + CStr(LEADRasterDoc.RecognizeStatus.RejectWordCount)
End If
End Sub

4.

Add the following code between the <HEAD> and </HEAD> tags to handle the RecognitionStatus event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterDoc" EVENT="RecognitionStatus(iRecogPage, iError)">
<!--
MsgBox "The page # " + CStr(iRecogPage) + "is finished its recognition" + Chr(13) + _
"The recognition return code = " + CStr(iError)
'continue to recognize next page
LEADRasterDoc.EnableStopRecognizeStatus = False
//-->
</SCRIPT>

5. | Run your page to test it.
6. | Save this page to use for testing other code samples.


Working with Recognition Results (Visual Basic Script)

Take the following steps to add code to the existing project that will let you save the recognition results:

1. | Start with the program you created in Recognizing Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Get Output Format" LANGUAGE="VBScript"
OnClick="GetOutputFormat" ID="Button9" NAME="Button8">

<INPUT TYPE="button" VALUE="Save Document" LANGUAGE="VBScript"
OnClick="SaveDocument" ID="Button10" NAME="Button8">

3.

Add the following code between the <SCRIPT> and </SCRIPT> tags:

Sub GetOutputFormat()
Dim nRet
nRet = LEADRasterDoc.GetOutputFileFormats
If (nRet <> 0) Then
MsgBox "Error" + CStr(nRet) + "in enumerating available file formats"
End If
End Sub

Sub SaveDocument()
Dim nRet
Dim FORMATLEVEL_FULL
Dim SELPREDEFINED
Dim PAPER_A4

FORMATLEVEL_FULL = 0
SELPREDEFINED = 2
PAPER_A4 = 0

nRet = LEADRasterDoc.GetRecognitionResultOptions
MsgBox "Format Name = " + LEADRasterDoc.FileFormatInfo.FormatName + Chr(13) + _
"Format DLL Name = " + LEADRasterDoc.FileFormatInfo.DLLName + Chr(13) + _
"Format Ext Name = " + LEADRasterDoc.FileFormatInfo.ExtName
If (nRet = 0) Then
LEADRasterDoc.ResultOptions.FormatLevel = FORMATLEVEL_FULL
LEADRasterDoc.ResultOptions.DocumentOptions.PaperSizeMode = SELPREDEFINED
LEADRasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4
End If

LEADRasterDoc.SetRecognitionResultOptions
nRet = LEADRasterDoc.SaveDocument("c:\test.doc")
If (nRet <> 0) Then
MsgBox "Error" + CStr(nRet) + "in saving recognition result to a file"
End If
End Sub

4.

Add the following code between the <HEAD> and </HEAD> tags to handle the EnumOutputFileFormats event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterDoc" EVENT="EnumOutputFileFormats(Format)">
<!--
Dim nRet
Dim OUTTYPE_WORD_PROCESSOR
Dim OUTTYPE_TRUE_WORD_PROCESSOR
Dim OUTTYPE_TABLE
Dim OUTTYPE_UNKNOWN

OUTTYPE_WORD_PROCESSOR = 1
OUTTYPE_TRUE_WORD_PROCESSOR = 2
OUTTYPE_TABLE = 3
OUTTYPE_UNKNOWN = 4

nRet = LEADRasterDoc.GetFileFormatInfo(Format)
If (nRet = 0) Then
MsgBox "Format Name = " + LEADRasterDoc.FileFormatInfo.FormatName + Chr(13) + _
"Format DLL Name = " + LEADRasterDoc.FileFormatInfo.DLLName + Chr(13) + _
"Format Ext Name = " + LEADRasterDoc.FileFormatInfo.ExtName

Select Case (LEADRasterDoc.FileFormatInfo.Type)
Case OUTTYPE_PLAIN
MsgBox "Format Type = Plain"

Case OUTTYPE_WORD_PROCESSOR
MsgBox "Format Type = Word Processor"

Case OUTTYPE_TRUE_WORD_PROCESSOR:
MsgBox "Format Type = True Word Processor"

Case OUTTYPE_TABLE
MsgBox "Format Type = Table"

Case OUTTYPE_UNKNOWN
MsgBox "Format Type = Unknown"
End Select

End If
//-->
</SCRIPT>

5.

Run your page to test it.


Tutorial for JavaScript Programmers

The following topics provide brief and simple examples to help you learn how to use the LEAD OCR Object Library.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax .

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Pages

Working with Recognition Results


Working with Pages (JavaScript)

Copy and paste the following code into an HTML file to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Window_OnUnload()
{
LEADRasterDoc.ShutDown();
}

function SetActiveLangs()
{
var nRet;
var LANGID_ENGLISH = 0;

LEADRasterDoc.ActiveLanguagesCount = 1;
LEADRasterDoc.ActiveLanguage(0) = LANGID_ENGLISH;
nRet = LEADRasterDoc.SelectLanguages();
if (nRet != 0)
alert("Error " + nRet + "Setting English as default language");
else
alert("English is Set as the active language");
}

function AddPage()
{
var L_SUPPORT_OCR = 3;

LEADRaster.UnlockSupport (L_SUPPORT_OCR, "OCR Key Goes Here");
LEADRasterDoc.StartUp();

var nPageNumber;
var nRet;

nRet = LEADRasterIO.Load (LEADRaster, "D:\\Ocr\\LETTER.TIF", 0, 0, 1);
if (nRet != 0)
alert("Error loading file");

nRet = LEADRasterDoc.AddPage(LEADRaster, nPageNumber);
if (nRet == 0)
alert("Page Width = " + LEADRasterDoc.PageWidth(nPageNumber) + "\n" + "Page Height = " + LEADRasterDoc.PageHeight(nPageNumber) + "\n" + "Page Bits Per Pixel = " + LEADRasterDoc.PageBitsPerPixel(nPageNumber));
else
alert("The engine could not add a new page to the Document");

SetActiveLangs();
}

function RemovePage()
{
var nRet;
var nPageCount;
var i;

nPageCount = LEADRasterDoc.PageCount;
for (i = 0; i < nPageCount; i++)
{
nRet = LEADRasterDoc.RemovePage(i);
if (nRet = 0)
alert("The page # " + i + "is removed successfully");
}
}

function FlipPage()
{
var nRet;

nRet = LEADRasterDoc.ExportPage(LEADRaster, 0);
LEADRasterProc.Flip (LEADRaster);
nRet = LEADRasterDoc.UpdatePage(LEADRaster, 0);
if (nRet == 0)
alert("The specified page is updated successfuly")
else
{
alert("Error " + nRet + " in updating page bitmap for page # 0");
LEADRasterDoc.ActivePageIndex = 0;
}
}
//-->
</SCRIPT>

<TITLE>LEADTOOLS JavaScript COM OCR Example</TITLE>
</HEAD>
<BODY onunload="Window_OnUnload()">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" ALIGN="baseline" BORDER="0" WIDTH="1"
HEIGHT="1" ID="Object1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<object classid="clsid:00140700-B1BA-11CE-ABC6-F5B2E79D9E3F" ID="LEADRaster">
</object>

<OBJECT ID="RasterIO" NAME="LEADRasterIO" CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<object classid="clsid:00140B30-B1BA-11CE-ABC6-F5B2E79D9E3F" ID="LEADRasterDoc">
</object>

<OBJECT ID="LEADRasterProc" NAME="LEADRasterProc" CLASSID="CLSID:00140712-B1BA-11CE-ABC6
F5B2E79D9E3F" CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<object classid="clsid:00140B4A-B1BA-11CE-ABC6-F5B2E79D9E3F" ID="ZoneData">
</object>

<FORM NAME="LEADForm" ID="Form1">
<INPUT TYPE="button" VALUE="Add Page" LANGUAGE="JavaScript" OnClick="AddPage()" ID="Button1"
NAME="Button1">
<INPUT TYPE="button" VALUE="Remove Page" LANGUAGE="JavaScript" OnClick="RemovePage()" ID="Button2"
NAME="Button2">
<INPUT TYPE="button" VALUE="Flip Page" LANGUAGE="JavaScript" OnClick="FlipPage()" ID="Button3"
NAME="Button3">
</FORM>
</BODY>
</HTML>


Working with Zones (JavaScript)

Take the following steps to add code to the existing page that will let you manipulate zones:

1. | Start with the program you created in Working with Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Find Zones" LANGUAGE="JavaScript"
OnClick="FindZones()" ID="Button4">

<INPUT TYPE="button" VALUE="Zones Count" LANGUAGE="JavaScript"
OnClick="ZonesCount()" ID="Button5">

<INPUT TYPE="button" VALUE="Verify Zone" LANGUAGE="JavaScript"
OnClick="VerifyZone()" ID="Button6">

3.

Add the following code to add an instance of the LTZoneData class:

<object classid="clsid:00140B4A-B1BA-11CE-ABC6-F5B2E79D9E3F">
</object>

4.

Add the following code between the <SCRIPT> and /SCRIPT> tags:

function FindZones()
{
var nRet;
LEADRasterDoc.GetAutoZoneOptions();
LEADRasterDoc.EnableZoneForceSingleColumn = true;
LEADRasterDoc.ShowZoneGridLines = true;

LEADRasterDoc.SetAutoZoneOptions();
nRet = LEADRasterDoc.FindZones(0, true);
if (nRet == 0)
alert("Automatic zones method finds all available zones into the specified pages successfully");
else
alert("Error" + nRet + "in finding available zone in the specified page");
}

function ZonesCount()
{
var nZoneCount;
nZoneCount = LEADRasterDoc.ZoneCount (0);
alert("Total Zones count = " + nZoneCount);
}

function VerifyZone()
{
var nZoneCount;
var nRet;
var i;
var ZONE_CHK_CHECKCBF_PROHIBIT = 4;

nZoneCount = LEADRasterDoc.ZoneCount(0);
for (i = 0; i < nZoneCount; i++)
{
nRet = LEADRasterDoc.GetZoneInfo(0, i, ZoneData);
if (nRet == 0)
{
if ((ZoneData.Flags & ZONE_CHK_CHECKCBF_PROHIBIT) == ZONE_CHK_CHECKCBF_PROHIBIT)
ZoneData.Flags = ZoneData.Flags & (!ZONE_CHK_CHECKCBF_PROHIBIT);

ZoneData.EnableVerificationEvent = true;
nRet = LEADRasterDoc.UpdateZone (0, i, ZoneData);

if (nRet != 0)
alert("Error" + nRet + "in updating zone # " + i)
}
}
}

5.

Add the following code between the <HEAD> and </HEAD> tags to handle the Verification event:

SCRIPT LANGUAGE="JavaScript" FOR="ZoneData" EVENT="Verification(iZoneIndex, bstrWord)">
<!--
var VF_ACCEPT = 4;

ZoneData.VerifyCode = VF_ACCEPT;
ZoneData.StopVerificationEvent = false;
//-->
</SCRIPT>

6. | Run your page to test it.
7. | Save this page to use for testing other code samples.


Recognizing Pages (JavaScript)

Take the following steps to add code to the existing page that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Recognize" LANGUAGE="JavaScript"
OnClick="Recognize()" ID="Button7" NAME="Button7">

<INPUT TYPE="button" VALUE="Get Status" LANGUAGE="JavaScript"
OnClick="GetStatus()" ID="Button8" NAME="Button8">

3.

Add the following code between the <SCRIPT> and </SCRIPT> tags:

function Recognize()
{
var nRet;
var LANGID_ENGLISH = 0;
LEADRasterDoc.SpellLanguageID = LANGID_ENGLISH;
LEADRasterDoc.EnableSubSystem = true;
LEADRasterDoc.EnableCorrection = true;

LEADRasterDoc.RecognitionDataFileName = "D:\\Ocr\\LETTER.TIF";

nRet = LEADRasterDoc.Recognize(0, 1);
if (nRet == 0)
alert("The engine finished recognizing the specified pages successfully");
else
alert("Error" + nRet + "in recognized specified pages");
}

function GetStatus()
{
var nRet;
LEADRasterDoc.EnableFireRecognizeStatus = true;
nRet = LEADRasterDoc.GetStatus();
if (nRet == 0)
alert("Recognition Time = " + LEADRasterDoc.RecognizeStatus.RecognizedTime + "\n" +
"Total Recognized Characters = " + LEADRasterDoc.RecognizeStatus.RecognizedCharacterCount + "\n" +
"Total Recognized Words = " + LEADRasterDoc.RecognizeStatus.RecognizedWordCount + "\n" +
"Total Rejected Characters = " + LEADRasterDoc.RecognizeStatus.RejectCharacterCount + "\n" +
"Total Rejected Words = " + LEADRasterDoc.RecognizeStatus.RejectWordCount);
}

4.

Add the following code between the <HEAD> and </HEAD> tags to handle the RecognitionStatus event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterDoc" EVENT="RecognitionStatus(iRecogPage, iError)">
<!--
alert("The page # " + iRecogPage + "is finished its recognition" + "\n" +
"The recognition return code = " + iError);
//continue to recognize next page
LEADRasterDoc.EnableStopRecognizeStatus = false;
//-->
</SCRIPT>

5. | Run your page to test it.
6. | Save this page to use for testing other code samples.


Working with Recognition Results (JavaScript)

Take the following steps to add code to the existing project that will let you save the recognition results:

1. | Start with the program you created in Recognizing Pages.
2. | Add the following code between the <BODY> and </BODY> tags to add three buttons to the page:

<INPUT TYPE="button" VALUE="Get Output Format" LANGUAGE="JavaScript"
OnClick="GetOutputFormat()" ID="Button9" NAME="Button8">

<INPUT TYPE="button" VALUE="Save Document" LANGUAGE="JavaScript"
OnClick="SaveDocument()" ID="Button10" NAME="Button8">

3.

Add the following code between the <SCRIPT> and </SCRIPT> tags:

function GetOutputFormat()
{
var nRet;
nRet = LEADRasterDoc.GetOutputFileFormats();
if (nRet != 0)
alert("Error" + nRet + "in enumerating available file formats");
}

function SaveDocument()
{
var nRet;
var FORMATLEVEL_FULL = 0;
var SELPREDEFINED = 2;
var PAPER_A4 = 0;

nRet = LEADRasterDoc.GetRecognitionResultOptions();
alert("Format Name = " + LEADRasterDoc.FileFormatInfo.FormatName + "\n" +
"Format DLL Name = " + LEADRasterDoc.FileFormatInfo.DLLName + "\n" +
"Format Ext Name = " + LEADRasterDoc.FileFormatInfo.ExtName);
if (nRet == 0)
{
LEADRasterDoc.ResultOptions.FormatLevel = FORMATLEVEL_FULL;
LEADRasterDoc.ResultOptions.DocumentOptions.PaperSizeMode = SELPREDEFINED;
LEADRasterDoc.ResultOptions.DocumentOptions.PaperType = PAPER_A4;
}

LEADRasterDoc.SetRecognitionResultOptions();
nRet = LEADRasterDoc.SaveDocument("c:\\test.doc");
if (nRet != 0)
alert("Error" + nRet + "in saving recognition result to a file");
}

4.

Add the following code between the <HEAD> and </HEAD> tags to handle the EnumOutputFileFormats event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterDoc" EVENT="EnumOutputFileFormats(Format)">
<!--
var nRet;
var OUTTYPE_PLAIN = 0;
var OUTTYPE_WORD_PROCESSOR = 1;
var OUTTYPE_TRUE_WORD_PROCESSOR = 2;
var OUTTYPE_TABLE = 3;
var OUTTYPE_UNKNOWN = 4;

nRet = LEADRasterDoc.GetFileFormatInfo(Format);
if (nRet == 0)
{
alert("Format Name = " + LEADRasterDoc.FileFormatInfo.FormatName + "\n" +
"Format DLL Name = " + LEADRasterDoc.FileFormatInfo.DLLName + "\n" +
"Format Ext Name = " + LEADRasterDoc.FileFormatInfo.ExtName);

switch (LEADRasterDoc.FileFormatInfo.Type)
{
case OUTTYPE_PLAIN:
alert("Format Type = Plain");
break;

case OUTTYPE_WORD_PROCESSOR:
alert("Format Type = Word Processor");
break;

case OUTTYPE_TRUE_WORD_PROCESSOR:
alert("Format Type = True Word Processor");
break;

case OUTTYPE_TABLE:
alert("Format Type = Table");
break;

case OUTTYPE_UNKNOWN:
alert("Format Type = Unknown");
break;
}
}
//-->
</SCRIPT>

5.

Run your page to test it.


Tutorial for Visual C++ 5.0 Programmers

The following topics provide brief and simple examples to help you learn how to use the LEAD OCR Object Library.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax .

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Working with Pages

Working with Zones

Recognizing Zones

Working with Recognition Results

Painting Pages and Zones

Miscellaneous Examples


Working With Pages (Visual C++ 5.0 and later))

Take the following steps to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File > New menu option, then do the following:
 | a. | Click the Projects tab.
 | b. | Select "MFC AppWizard (exe)" as the project type
 | c. | In the Project name text box, specify "OCRTutor".
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D controls is selected.
 | c. | Select OLE controls (ActiveX controls in 5.0).
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read the New Project Information, and click OK. (The AppWizard creates the project files and opens the project).
7. | Add #import and #include statements to your program so you can access the LEAD OCR COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the OCRTutor Files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dlls reside):

#import <LTRDC14N.DLL> no_namespace, named_guids
#import <ltrvr14n.dll> no_namespace, named_guids
#import <ltr14n.dll> no_namespace, named_guids
#import <ltrpr14n.dll> no_namespace, named_guids
#import <ltrio14n.dll> no_namespace, named_guids, exclude("LoadResizeConstants")

8. | Add seven command buttons to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_STARTUP | Start Up
 | IDC_ADDPAGE | Add Page
 | IDC_SETLANGUAGES | Set Langs
 | IDC_SHUTDOWN | Shut Down
 | IDC_REMOVEPAGE | Remove Page
 | IDC_FLIPPAGE | Flip Page
9. | Edit the OCRTutorDlg.h file and change the definition of COCRTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:

ILEADRasterDocument *m_pRasterDoc;
ILEADRaster *m_pRaster;
ILEADRasterIO * m_pRasterIO;

10.

Edit the OCRTutorDlg.cpp file and add the following to the OnInitDialog procedure as follows:

m_pRasterDoc = NULL;
m_pRaster = NULL;
m_pRasterIO = NULL;

11. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_STARTUP.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnStartup).
 | f. | Click the Edit Code button and code the OnStartup procedure as follows:

HRESULT hr = CoCreateInstance(CLSID_LEADRasterDocument, NULL, CLSCTX_ALL, IID_ILEADRasterDocument, (void**)&m_pRasterDoc);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

//create a temp LEADRaster object and use it
//to unlock support for the OCR Document object
hr = S_OK;
IClassFactory2 *pCF2=NULL;
CLSID clsid;

static const WCHAR BASED_CODE_szID[] = L"LEADRaster.LEADRaster";

CLSIDFromProgID(_szID, &clsid);
hr = CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory, (void**)&pCF2);
if (FAILED (hr))
{
AfxMessageBox (TEXT("Failed to create a Class Factory Object. The Demo will not work properly ..."));
}
else
{
//This object is licensed, so we need to pass a license key
static const WCHAR BASED_CODE_szLic[] = L"LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLic);
pCF2->CreateInstanceLic(NULL, NULL, IID_IUnknown, lpLic, (void**)&m_pRaster);
SysFreeString(lpLic);
pCF2->Release();

// notice the OCR key is a test key.
m_pRaster->UnlockSupport(L_SUPPORT_OCR, "TestKey");
}

int nRet = m_pRasterDoc->StartUp ();
if (nRet != 0)
{
AfxMessageBox(TEXT("Can't start the OCR engine."));
m_pRasterDoc->Release();
m_pRasterDoc = NULL;
}

12. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_SHUTDOWN.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnShutdown).
 | f. | Click the Edit Code button and code the OnShutdown procedure as follows:

int nRet = m_pRasterDoc->ShutDown();
if(nRet != 0)
AfxMessageBox(TEXT("The engine could not be shut down!"));
else
{
if(m_pRasterDoc)
m_pRasterDoc->Release();

if(m_pRaster)
m_pRaster->Release();

if(m_pRasterIO)
m_pRasterIO->Release();
}

13. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_ADDPAGE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnAddpage).
 | f. | Click the Edit Code button and code the OnAddpage procedure as follows:

CString csBuffer;

HRESULT hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the Raster IO Object..."));
return;
}
int nRet = m_pRasterIO->Load(m_pRaster,"c:\\OCRTEST.gif", 0, 0, 1);
if(nRet!=0)
{
AfxMessageBox(TEXT("Error loading file"));
return;
}

int nRet = m_pRasterDoc->AddPage(m_pRaster, 0);
if(nRet == 0)
{
AfxMessageBox(TEXT("The engine added a new page to the document."));

csBuffer.Format (TEXT("Page Width = %d\nPage Height = %d\nPage Bits Per Pixel = %d\n"),
m_pRasterDoc->PageWidth [0],
m_pRasterDoc->PageHeight [0],
m_pRasterDoc->PageBitsPerPixel [0]);

AfxMessageBox(csBuffer);
}
else
AfxMessageBox(TEXT("The engine could not add a new page to the document."));

14. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_SETLANGUAGES.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnSetlanguages).
 | f. | Click the Edit Code button and code the OnSetlanguages procedure as follows:

CString csBuffer;
m_pRasterDoc->ActiveLanguagesCount = 1;
m_pRasterDoc->ActiveLanguage[0] = LANGID_ENGLISH;
nRet = m_pRasterDoc->SelectLanguages ();
if (nRet != 0)
{
csBuffer.Format (TEXT("Error %d Setting English as default language"), nRet);
AfxMessageBox (csBuffer);
}
else
AfxMessageBox(TEXT("English is set as the active language."));

15. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_REMOVEPAGE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnRemovepage).
 | f. | Click the Edit Code button and code the OnRemovepage procedure as follows:

int nPageCount = 0;
int i, nRet;
CString csBuffer;

nPageCount = m_pRasterDoc->PageCount;
for (i=0; i<nPageCount; i++)
{
nRet = m_pRasterDoc->RemovePage(i);
if (nRet == 0)
{
csBuffer.Format (TEXT("Page # %d was removed successfully."), i);
AfxMessageBox(csBuffer);
}
}

16. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_FLIPPAGE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnFlippage).
 | f. | Click the Edit Code button and code the OnFlippage procedure as follows:

CString csBuffer;
ILEADRasterProcess * pRasterProc;

int nRet = m_pRasterDoc->ExportPage (m_pRaster, 0);
{
HRESULT hr = CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

pRasterProc->Flip(m_pRaster);
nRet = m_pRasterDoc->UpdatePage (m_pRaster, 0);
if (nRet == 0)
{
csBuffer.Format (TEXT("The specified page was updated successfully."));

AfxMessageBox (csBuffer);
}
else
{
csBuffer.Format (TEXT("Error %d in updating page bitmap for page # 0"), nRet);
AfxMessageBox (csBuffer);
}

m_pRasterDoc->ActivePageIndex = 0;
pRasterProc->Release();
}

17. | On the Build menu, select Build OCRTutor.exe.
18. | On the Build menu, select Execute OCRTutor.exe.
19. | Save this project to use for testing other code samples.


Working With Zones (Visual C++ 5.0 and later))

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add the following command buttons to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_FINDZONES | Find Zones
 | IDC_ZONESCOUNT | Zones Count
 | IDC_VERIFYZONE | Verify Zone
3. | Edit the OCRTutorDlg.h file and change the definition of COCRTutorDlg : CDialog by inserting the following line after DECLARE_MESSAGE_MAP:

ILTZoneData* m_pZoneData;
CSampleZoneSink * m_pZoneSink;
IConnectionPoint *m_pZoneCP;
DWORD m_dwZoneCookie;

4.

Edit the OCRTutorDlg.h file and add the following to the OnShutdown procrdure:

if (m_pZoneData)
{
if (m_pZoneSink)
{
LPUNKNOWN pUnkSink = m_pZoneSink->GetIDispatch(FALSE);
if (m_pZoneData)
AfxConnectionUnadvise(m_pZoneData, DIID__LTZoneDataEvents, pUnkSink, FALSE, m_dwZoneCookie);

delete m_pZoneSink;
m_pZoneSink = NULL;
}

m_pZoneData->Release();
m_pZoneData = NULL;
}

5.

Edit the OCRTutorDlg.cpp file and add the following to the OnInitDialog procedure as follows:

m_pZoneData = NULL;

6. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CSampleZoneSink for the name of the class.
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the SampleZoneSink.h file, move the destructor so that it is public:

// Implementation
virtual ~ CSampleZoneSink();
protected:

h.

In the SampleZoneSink.h file, add the following to the top of the file:

class COCRTutorDlg;

i.

In the SampleZoneSink.h file, add the following to the CSampleZoneSink class in the //Attributes public section:

// Attributes
public:
COCRTutorDlg *m_pDlg;

j.

In the SampleZoneSink.cpp file, add the following to the top of the file (after the #include "SampleZoneSink.h")

#include "OCRTutorDlg.h"

7. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the OCRTutor Files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the SampleZoneSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnVerification (short iZoneIndex, BSTR bstrWord);

f. | Double-click the Source Files folder to open it.
g. | Double-click the SampleZoneSink.cpp file to edit it.
h. | Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CSamplerZoneSink, DIID__LTZoneDataEvents, Dispatch)

8. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Source Files folder.
 | c. | Double-click the SampleZoneSink.cpp file to edit it.
 | d. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CSampleZoneSink,"Verification",1, OnVerification,VT_NONE,VTS_I4,VTS_BSTR)

e.

Add the following to the end of the file:

void CSampleZoneSink::OnVerification (short iZoneIndex, BSTR bstrWord)
{
m_pDlg->m_pZoneData-> VerifyCode = VF_ACCEPT;
m_pDlg->m_pZoneData-> StopVerificationEvent = FALSE:
}

9. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the OCRTutor files folder to open it.
 | c. | Double-click the Header files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "SampleZoneSink.h"

10. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_FINDZONES.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnFindzones).
 | f. | Click the Edit Code button and code the OnFindzones procedure as follows:

CString csBuffer;
m_pRasterDoc->GetAutoZoneOptions ();
m_pRasterDoc->EnableZoneForceSingleColumn = TRUE;
m_pRasterDoc->ShowZoneGridLines = TRUE;
m_pRasterDoc->SetAutoZoneOptions ();
int nRet = m_pRasterDoc->FindZones (0, TRUE);
if (nRet == 0)
AfxMessageBox(TEXT("Automatic zones method found all available zones in the specified pages successfully."));
else
{
csBuffer.Format (TEXT("Error %d in finding available zone in the specified page"), nRet);
AfxMessageBox (csBuffer);
}

11. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_ZONESCOUNT.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnZonescount).
 | f. | Click the Edit Code button and code the OnZonescount procedure as follows:

CString csBuffer;
int nZoneCount;
nZoneCount = m_pRasterDoc->ZoneCount [0];
csBuffer.Format (TEXT("Total Zones count = %d\n"), nZoneCount);
AfxMessageBox(csBuffer);

12. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_VERIFYZONE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnVerifyzone).
 | f. | Click the Edit Code button and code the OnVerifyzone procedure as follows:

CString csBuffer;
int nZoneCount;
int nRet;

HRESULT hr = CoCreateInstance(CLSID_LTZoneData, NULL, CLSCTX_ALL, IID_ILTZoneData, (void**)&m_pZoneData);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the Zone Data Object..."));
return;
}

m_pZoneSink = new CSampleZoneSink;
m_pZoneSink->m_pView = this;

LPUNKNOWN pUnkSink = m_pZoneSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pZoneData, DIID__LTZoneDataEvents, pUnkSink, FALSE, &m_dwZoneCookie);

nZoneCount = m_pRasterDoc->ZoneCount [0];
for(int i=0; i<nZoneCount; i++)
{
nRet = m_pRasterDoc->GetZoneInfo (0, i, m_pZoneData);
if (nRet == 0)
{

m_pZoneData->EnableVerificationEvent = TRUE;
nRet = m_pRasterDoc->UpdateZone (0, i, m_pZoneData);
if (nRet != 0)
{
csBuffer.Format (TEXT("Error %d in updating zone # %d"), nRet, i);
AfxMessageBox (csBuffer);
}
}
}

13. | On the Build menu, select Build OCRTutor.exe.
14. | On the Build menu, select Execute OCRTutor.exe.
15. | Save this project to use for testing other code samples.


Recognizing Zones(Visual C++ 5.0 and later)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones.
2. | Add the following command buttons to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_RECOGNIZE | Recognize
 | IDC_GETSTATUS | Get Status

3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_RECOGNIZE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnRecognize).
 | f. | Click the Edit Code button and code the OnRecognize procedure as follows:

CString csBuffer;
m_pRasterDoc->SpellLanguageID = LANGID_ENGLISH;
m_pRasterDoc->EnableSubSystem = TRUE;
m_pRasterDoc->EnableCorrection = TRUE;

m_pRasterDoc->RecognitionDataFileName = "c:\\testrdf.rdf";

int nRet = m_pRasterDoc->Recognize (0,1);
if(nRet == 0)
AfxMessageBox(TEXT("The engine finished recognizing the specified pages successfully."));
else
{
csBuffer.Format (TEXT("Error %d in recognized specified pages"), nRet);
AfxMessageBox (csBuffer);
}

4.

Press Ctrl-W to go to the MFC Class Wizard; then do the following:

a. | Click the Message Maps tab.
b. | In the Class Name combo box, select COCRTutorDlg.
c. | In the Object IDs list box, select IDC_GETSTATUS.
d. | In the Messages list box, select BN_CLICKED
e. | Click the Add function button. Choose OK for the default function name (OnGetstatus).
f. | Click the Edit Code button and code the OnGetstatus procedure as follows:

CString csBuffer;

int nRet = m_pRasterDoc->GetStatus ();
if (nRet == 0)
{
csBuffer.Format (TEXT("Recognition Time = %d\nTotal Recognized Characters = %d\nTotal Recognized Words = %d\nTotal Rejected Characters = %d\nTotal Rejected Words = %d\n"),
m_pRasterDoc->GetRecognizeStatus()->RecognizedTime,
m_pRasterDoc->GetRecognizeStatus()->RecognizedCharacterCount,
m_pRasterDoc->GetRecognizeStatus()->RecognizedWordCount,
m_pRasterDoc->GetRecognizeStatus()->RejectCharacterCount,
m_pRasterDoc->GetRecognizeStatus()->RejectWordCount);
AfxMessageBox(csBuffer);
}

5.

Edit the OCRTutorDlg.h file and change the definition of COCRTutorDlg : CDialog by inserting the following line after DECLARE_MESSAGE_MAP:

public:
CRasterOCRSink * m_pRasterOCRSink;
IConnectionPoint *m_pOCRCP;
DWORD m_dwOCRCookie;

6. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterOCRSink for the name of the class.
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterOCRSink.h file, move the destructor so that it is public:

// Implementation
virtual ~ CRasterOCRSink();
protected:

h.

In the RasterOCRSink.h file, add the following to the top of the file:

class COCRTutorDlg;

i.

In the RasterOCRSink.h file, add the following to the CRasterOCRSink class in the //Attributes public section:

// Attributes
public:
COCRTutorDlg *m_pDlg;

j.

In the RasterOCRSink.cpp file, add the following to the top of the file (after the #include "RasterOCRSink.h")

#include "OCRTutorDlg.h"

7.

Add #include statements so you can access the new class:

a. | In the Project Workspace, click the FileView tab.
b. | Double-click the OCRTutor files folder to open it.
c. | Double-click the Header files folder to open it.
d. | Double-click the StdAfx.h file to edit it.
e. | Add the following lines to the end of the file:

#include "RasterOCRSink.h"

8. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the OCRTutor Files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterOCRSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnRecognitionStatus (short iRecogPage, short iError);

f. | Double-click the Source Files folder to open it.
g. | Double-click the RasterOCRSink.cpp file to edit it.
h. | Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CRasterOCRSink, DIID__LEADRasterDocEvents, Dispatch)

9. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Source Files folder.
 | c. | Double-click the RasterOCRSink.cpp file to edit it.
 | d. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterOCRSink,"RecognitionStatus",2, OnRecognitionStatus,VT_EMPTY, VTS_I2 VTS_I2)

    1. Add the following to the end of the file:

void CRasterOCRSink::OnRecognitionStatus (short iRecogPage, short iError)
{
CString csBuffer;
csBuffer.Format (TEXT("The page # %d has finished its recognition.\nThe recognition return code = %d\n"), iRecogPage, iError);
AfxMessageBox(csBuffer);
// continue to recognize next page
m_pDlg->m_pRasterDoc->EnableStopRecognizeStatus = FALSE;
}

10.

Edit the OCRTutorDlg.cpp file and add the following to the OnStartup procedure:

m_pRasterOCRSink = new CRasterOCRSink;
m_pRasterOCRSink->m_pDlg = this;

LPUNKNOWN pUnkSink = m_pRasterOCRSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterDoc, DIID__LEADRasterOCREvents, pUnkSink, FALSE, &m_dwOCRCookie);

11.

Edit the OCRTutorDlg.cpp file and add the following to the OnShutdown procedure:

LPUNKNOWN pUnkSink = m_pRasterOCRSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterDoc, DIID__LEADRasterOCREvents, pUnkSink, FALSE, m_dwOCRCookie);
delete m_pRasterOCRSink;
m_pRasterOCR->Release ();

12. | On the Build menu, select Build OCRTutor.exe.
13. | On the Build menu, select Execute OCRTutor.exe.
14. | Save this project to use for testing other code samples.


Working With Recognition Results (Visual C++ 5.0 and later))

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones.
2. | Add the following command buttons to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_GET_OUTPUTFORMAT | Get Output Format
 | IDC_SAVE_DOCUMENT | Save Document

3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_GET_OUTPUTFORMAT.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnGetOutputformat).
 | f. | Click the Edit Code button and code the OnGetOutputformat procedure as follows:

CString csBuffer;
nRet = m_pRasterDoc->GetOutputFileFormats ();
if (nRet != 0)
{
csBuffer.Format (TEXT("Error %d in enumerating available file formats"), nRet);
AfxMessageBox (csBuffer);
}

4. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_SAVE_DOCUMENT.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnSaveDocument).
 | f. | Click the Edit Code button and code the OnSaveDocument procedure as follows:

CString csBuffer;

int nRet = m_pRasterDoc->GetRecognitionResultOptions ();
if (nRet == 0)
{
m_pRasterDoc->GetResultOptions ()->FormatLevel = FORMATLEVEL_FULL;
m_pRasterDoc->GetResultOptions()->GetDocumentOptions ()->PaperSizeMode = SELPREDEFINED;
m_pRasterDoc->GetResultOptions ()->GetDocumentOptions ()->PaperType = PAPER_A4;

m_pRasterDoc->SetRecognitionResultOptions ();
nRet = m_pRasterDoc->SaveDocument ("c:\\test.doc");
if (nRet != 0)
{
csBuffer.Format (TEXT("Error %d in saving recognition result to a file"), nRet);
AfxMessageBox (csBuffer);
}
}

5. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the OCRTutor Files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterOCRSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void On EnumOutputFileFormats (FORMATTYPE Format);

f. | Edit the source for the Sink class:
g. | In the Project Workspace, click the FileView tab.
h. | Double-click the Source Files folder.
i. | Double-click the RasterOCRSink.cpp file to edit it.
j. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterOCRSink," EnumOutputFileFormats",3, OnEnumOutputFileFormats, VT_EMPTY, VTS_I2)

k.

Add the following to the end of the file:

int nRet;
CString csBuffer;

nRet = this->m_pDlg->m_pRasterDoc->GetFileFormatInfo (Format);
if (nRet == 0)
{
csBuffer.Format (TEXT("Format Name = %s\nFormat DLL Name = %s\nFormat Ext Name = %s\n"),
m_pDlg->m_pRasterDoc->GetFileFormatInfo ()->FormatName,
m_pDlg->m_pRasterDoc->GetFileFormatInfo ()->DLLName,
m_pDlg->m_pRasterDoc->GetFileFormatInfo ()->ExtName);

AfxMessageBox(csBuffer);

FORMAT_OUTPUT_TYPE type = m_pDlg->m_pRasterDoc->GetFileFormatInfo ()->Type;

switch (type)
{
case OUTTYPE_PLAIN:
csBuffer.Format (TEXT("Format Type = Plain"));
break;
case OUTTYPE_WORD_PROCESSOR:
csBuffer.Format (TEXT("Format Type = Word Processor"));
break;
case OUTTYPE_TRUE_WORD_PROCESSOR:
csBuffer.Format (TEXT("Format Type = True Word Processor"));
break;
case OUTTYPE_TABLE:
csBuffer.Format (TEXT("Format Type = Table"));
break;
case OUTTYPE_UNKNOWN:
csBuffer.Format (TEXT("Format Type = Unknown"));
break;
}

AfxMessageBox(csBuffer);
}

6. | Build OCRTutor.exe.
7. | Run OCRTutor.exe.


Painting Pages and Zones (Visual C++ 5.0 and later))

Painting Pages and Zones

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages.
2. | Add the following command buttons to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_DRAW_ZONES | Draw Zones
 | IDC_DRAWPAGE | Draw Page
3. | Edit the OCRTutorDlg.h file and change the definition of COCRTutorDlg : CDialog by inserting the following line after DECLARE_MESSAGE_MAP:

BOOL m_bDrawZones;
BOOL m_bDrawPage;

4.

Edit the OCRTutorDlg.cpp file and add the following to the OnInitDialog procedure as follows:

m_bDrawZones = FALSE;
m_bDrawPage = TRUE;

5. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_DRAW_ZONES.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnDrawZones).
 | f. | Click the Edit Code button and code the OnDrawZones procedure as follows:

m_bDrawZones = !m_bDrawZones;

6.

Edit the OnAddpage procedure, add the following lines after "AddPage()…":

m_bDrawPage = FALSE;
m_pRasterDoc-> ActivePageIndex = 0;
m_bDrawPage = TRUE;

7. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select COCRTutorDlg.
 | c. | In the Object IDs list box, select IDC_DRAWPAGE.
 | d. | In the Messages list box, select BN_CLICKED
 | e. | Click the Add function button. Choose OK for the default function name (OnDrawpage).
 | f. | Click the Edit Code button and code the OnDrawpage procedure as follows:

if (m_bDrawPage)
{
CClientDC * pDc = new CClientDC(this);
m_pRasterDoc->EnableShowZones = m_bDrawZones;
m_pRasterDoc->DrawPersistence = FALSE;
m_pRasterDoc->DrawPage (NULL, (long)pDc->m_hDC, 0);
}

8. | Build OCRTutor.exe.
9. | Run OCRTutor.exe.


Miscellaneous Examples (Visual C++ 5.0 and later)

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

AddPage Example for C++ 5.0 and later

AddZone Example for C++ 5.0 and later

AutoOrientPage Example for C++ 5.0 and later

CharacterOptions Example for C++ 5.0 and later

DefaultPageFillMethod Example for C++ 5.0 and later

DetectOrientationDegree Example for C++ 5.0 and later

EnableParallelRecognition Visual C++ 5.0 example

EnableProgressStatusEvent Example for C++ 5.0 and later

EnableStopRecognizeStatus Example for C++ 5.0 and later

ExportPage Example for C++ 5.0 and later

ExportZones Example for C++ 5.0 and later

FindZones Example for C++ 5.0 and later

GetOutputFileFormats Example for C++ 5.0 and later

GetRecognizedCharacters Example for C++ 5.0 and later

GetStatus Example for C++ 5.0 and later

GetZoneInfo Example for C++ 5.0 and later

IsCharacterEnabled Example for C++ 5.0 and later

MarkOptions Example for C++ 5.0 and later

MemoryRecognitionResultSize Example for C++ 5.0 and later

MOREnableFax Example for C++ 5.0 and later

OffsetZones Example for C++ 5.0 and later

PageWidth Example for C++ 5.0 and later

ParagraphOptions Example for C++ 5.0 and later

RemoveItemFromUserDictionary Example for C++ 5.0 and later

RemovePage Example for C++ 5.0 and later

RemoveSelectedZone Example for C++ 5.0 and later

RemoveZone Example for C++ 5.0 and later

ResultOptions Example for C++ 5.0 and later

SelectLanguages Example for C++ 5.0 and later

SelectZoneByPoint Example for C++ 5.0 and later

SetHandPrintOptions Example for C++ 5.0 and later

SetOMROptions Example for C++ 5.0 and later

SetUserDictionary Example for C++ 5.0 and later

SpecialRejectedCharacter Example for C++ 5.0 and later

StartUp Example for C++ 5.0 and later

StopVerificationEvent Example for C++ 5.0 and later

UpdatePage Example for C++ 5.0 and later

UpdateZoneArea Example for C++ 5.0 and later

ZoneLeft Example for C++ 5.0 and later


AddPage Example for Visual C++ 5.0

AddPage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton3()
{
short nPageNumber = 0;
int nPageCount = 0;
CString csBuffer;

nPageNumber = 1;
int nRet = pRasterDoc->AddPage (pRaster, nPageNumber);
if(nRet == 0)
AfxMessageBox(TEXT("The engine added a new page to the document."));
else
AfxMessageBox(TEXT("The engine could not add a new page to the document."));

nPageCount = pRasterDoc->PageCount;
csBuffer.Format (TEXT("The number of pages in the document is: %d"),nPageCount);
AfxMessageBox(csBuffer);
}


AddZone Example for Visual C++ 5.0

AddZone Example for C++ 5.0 and later

void CSample_COMDlg::OnButton8()
{
int nZoneCount = 0;
CString csBuffer;
ILTZoneData* pZoneData = NULL;

HRESULT hr = CoCreateInstance(CLSID_LTZoneData, NULL, CLSCTX_ALL, IID_ILTZoneData, (void**)&pZoneData);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

pZoneData->Left = 100;
pZoneData->Top = 100;
pZoneData->Right = 200;
pZoneData->Bottom = 200;
pZoneData->FillMethod = FM_DEFAULT;
pZoneData->RecognizeModule = RECOGNIZE_MODULE_AUTO;
pZoneData->CharacterFilter = CHAR_FILTER_DEFAULT;
pZoneData->Type = ZONE_TYPE_FLOWTEXT;
pZoneData->Flags = 0;
pZoneData->EnableVerificationEvent = FALSE;
pZoneData->SectionName = "cities";

int nRet = pRasterDoc->AddZone(0, 0, pZoneData);
if (nRet == 0)
{
CString csMsg;
csMsg.Format (TEXT("The engine added a new zone to the document successfully.\nThe Added Zone ID = %d\n"),
pZoneData->ID);
AfxMessageBox(csMsg);
}
else
AfxMessageBox(TEXT("The engine could not add a new zone to the document."));

nZoneCount = pRasterDoc->ZoneCount [0];
csBuffer.Format (TEXT("Total zones in the specified page: %d"),nZoneCount);

pZoneData->Release();
}


AutoOrientPage Example for Visual C++ 5.0

AutoOrientPage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton4()
{
int nRet = pRasterDoc->AutoOrientPage(0);
if (nRet != 0)
AfxMessageBox(TEXT("Failure during auto orient the current page"));
}


CharacterOptions Example for Visual C++ 5.0

CharacterOptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton36()
{
pRasterDoc->GetRecognitionResultOptions ();

// Update Character Options...
pRasterDoc->GetResultOptions ()->GetCharacterOptions ()->SelOutputFont = SELPREDEFINED;
pRasterDoc->GetResultOptions ()->GetCharacterOptions ()->FontNames [0] = FONTPROPORTSERIF;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->FontNames [1] = FONTPREDEFFONT;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->FontNames [2] = FONTMONOSERIF;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->FontNames [3] = FONTPROPORTSANSSERIF;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->FontNames [4] = FONTMONOSANSSERIF;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->Size = 24;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->Bold = TRUE;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->Italic = FALSE;
pRasterDoc->GetResultOptions()->GetCharacterOptions ()->Underline = TRUE;

pRasterDoc->SetRecognitionResultOptions ();
}


DefaultPageFillMethod Example for Visual C++ 5.0

DefaultPageFillMethod Example for C++ 5.0 and later

void CSample_COMDlg::OnButton9()
{
FILL_METHOD fm = pRasterDoc->DefaultPageFillMethod [0];
if (fm == FM_OMR)
AfxMessageBox(TEXT("The Default Fill Method used in the specified page is Fill OMR."));
}


DetectOrientationDegree Example for Visual C++ 5.0

DetectOrientationDegree Example for C++ 5.0 and later

void CSample_COMDlg::OnButton4()
{
long lDegree = pRasterDoc->GetDetectOrientationDegree(0);
CString csBuffer;

csBuffer.Format("Orientation degree = %d" + lDegree);
AfxMessageBox(csBuffer);
}


DefaultSpellLanguagesCount Example for Visual C++ 5.0

DefaultSpellLanguagesCount Example for C++ 5.0 and later

void CSample_COMDlg::OnButton16()
{
int nLangCount = 0;
CString csMsg;

nLangCount = pRasterDoc->DefaultSpellLanguagesCount;
csMsg.Format (TEXT("Total Default Spell Languages = %d"), nLangCount);
AfxMessageBox(csMsg);

if (nLangCount > 0)
{
if (pRasterDoc->RecognizeModuleTradeoff != RECOG_MODULE_ACCURATE)
pRasterDoc->RecognizeModuleTradeoff = RECOG_MODULE_ACCURATE;

pRasterDoc->EnableSubSystem = TRUE;
pRasterDoc->EnableCorrection = TRUE;
pRasterDoc->SpellLanguageID = pRasterDoc->DefaultSpellLanguages [0];
pRasterDoc->EnableFireRecognizeStatus = TRUE;
pRasterDoc->EnableSaveResultsToMemory = TRUE;
pRasterDoc->RecognitionDataFileName = "c:\\testrdf.rdf";

pRasterDoc->Recognize (0, 1);
}
}


DrawPage Example for Visual C++ 5.0

DrawPage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton27()
{
pRasterDoc->ActivePageIndex = 0;
pRasterDoc->EnableShowZones = TRUE;

pRasterDoc->SelectedZonePenStyle = PENSTYLE_SOLID;
pRasterDoc->SelectedZonePenWidth = 3;
pRasterDoc->SelectedZonePenColor = RGB(255, 0, 0);

pRasterDoc->SetSelectedZonePen ();

pRasterDoc->ZonePenStyle = PENSTYLE_SOLID;
pRasterDoc->ZonePenWidth = 3;
pRasterDoc->ZonePenColor = RGB(0, 0, 0);

pRasterDoc->SetZonePen ();

pRasterDoc->PutScaleMode (SCALEMODE_PIXEL);

pRasterDoc->SourceLeft = 0;
pRasterDoc->SourceTop = 0;
pRasterDoc->SourceWidth = pRasterDoc->PageWidth [0];
pRasterDoc->SourceHeight = pRasterDoc->PageHeight [0];

pRasterDoc->SourceClipLeft = 0;
pRasterDoc->SourceClipTop = 0;
pRasterDoc->SourceClipWidth = 0;
pRasterDoc->SourceClipHeight = 0;

pRasterDoc->DestinationLeft = 0;
pRasterDoc->DestinationTop = 0;
pRasterDoc->DestinationWidth = pRasterDoc->PageWidth [0];
pRasterDoc->DestinationHeight = pRasterDoc->PageHeight [0];

pRasterDoc->DestinationClipLeft = 0;
pRasterDoc->DestinationClipTop = 0;
pRasterDoc->DestinationClipWidth = 0;
pRasterDoc->DestinationClipHeight = 0;

CClientDC * pDc = new CClientDC(this);

pRasterDoc->DrawPersistence = FALSE;
pRasterDoc->SelectZone(NULL, (long)pDc->m_hDC, 0, 0, TRUE);
pRasterDoc->DrawPage (NULL, (long)pDc->m_hDC, 0);
}


EnableParallelRecognition Example for Visual C++ 5.0

EnableParallelRecognition Visual C++ 5.0 example

void CSample_COMDlg::TestParallelRecognition()
{
BOOL bEnable = pRasterDoc->EnableParallelRecognition;
if (!bEnable)
pRasterDoc->EnableParallelRecognition = TRUE;

AfxMessageBox(TEXT("The Parallel Recognition Mode is enabled."));
}


EnableProgressStatusEvent Example for Visual C++ 5.0

EnableProgressStatusEvent Example for C++ 5.0 and later

void CSampleSink::OnProgressStatus(OCR_PROCESS_ID ID, short iPercent, short iAcceptCharCount, short iRejectCharCount, long lObjSize, BSTR bstrObjData)
{
pRasterDoc->StopProgressStatusEvent = FALSE;
}

void CSample_COMDlg::OnButton2()
{
int nRet = pRasterDoc->EnableProgressStatusEvent(TRUE);
if (nRet == 0)
AfxMessageBox(TEXT("The Progress Status was called."));
}


EnableStopRecognizeStatus Example for Visual C++ 5.0

EnableStopRecognizeStatus Example for C++ 5.0 and later

void CSampleSink::OnRecognitionStatus (short iRecogPage, short iError)
{
CString csBuffer;

csBuffer.Format (TEXT("Recognized page index = %d\nRecognition Return value = %d\n"), iRecogPage, iError);
AfxMessageBox(csBuffer);

m_pRasterDoc->EnableStopRecognizeStatus = FALSE;
}

void CSample_COMDlg::OnButton16()
{
int nLangCount = 0;
CString csMsg;

nLangCount = pRasterDoc->DefaultSpellLanguagesCount;
csMsg.Format (TEXT("Total Default Spelling Languages = %d"), nLangCount);
AfxMessageBox(csMsg);

if (nLangCount > 0)
{
if (pRasterDoc->RecognizeModuleTradeoff != RECOG_MODULE_ACCURATE)
pRasterDoc->RecognizeModuleTradeoff = RECOG_MODULE_ACCURATE;

pRasterDoc->EnableSubSystem = TRUE;
pRasterDoc->EnableCorrection = TRUE;
pRasterDoc->SpellLanguageID = pRasterDoc->DefaultSpellLanguages [0];
pRasterDoc->EnableFireRecognizeStatus = TRUE;
pRasterDoc->EnableSaveResultsToMemory = TRUE;
pRasterDoc->RecognitionDataFileName = "c:\\testrdf.rdf";

pRasterDoc->Recognize (0, 1);
}
}


ExportPage Example for Visual C++ 5.0

ExportPage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton5()
{
int nRet = pRasterDoc->ExportPage (pRaster, 0);
if (nRet == 0)
AfxMessageBox(TEXT("The engine exported the specified page."));
else
AfxMessageBox(TEXT("The engine couldn't export the specified page."));
}


ExportZones Example for Visual C++ 5.0

ExportZones Example for C++ 5.0 and later

void CSample_COMDlg::OnButton13()
{
int nRet = pRasterDoc->ImportZones (0, "c:\\zone.zon");
if (nRet == 0)
AfxMessageBox(TEXT("Imports the zone file into the specified page."));

//...
// work with zones...
//...

// exports page zone list to Zone file...
nRet = pRasterDoc->ExportZones (0, "c:\\zone.zon");
if (nRet == 0)
AfxMessageBox(TEXT("Exports the zone list into a zone file."));
}


FindZones Example for Visual C++ 5.0

FindZones Example for C++ 5.0 and later

void CSample_COMDlg::OnButton11()
{
pRasterDoc->GetAutoZoneOptions ();

pRasterDoc->ShowZoneGridLines = TRUE;
pRasterDoc->EnableZoneForceSingleColumn = TRUE;
pRasterDoc->ZoneParser = PARSER_AUTO;

pRasterDoc->SetAutoZoneOptions ();

int nRet = pRasterDoc->FindZones (0, TRUE);
if(nRet == 0)
AfxMessageBox(TEXT("The engine found all available zones in the specified page."));
}


GetOutputFileFormats Example for Visual C++ 5.0

GetOutputFileFormats Example for C++ 5.0 and later

void CSampleSink::OnEnumOutputFileFormats (FORMATTYPE Format)
{
FORMATTYPE Format;
if (Format == DOCRTF_WORD_2000)
{
CString csString;
pRasterDoc->GetFileFormatInfo (DOCRTF_WORD_2000);

csString.Format (TEXT("Format Name = %s\nFormat DLL Name = %s\nFormat Ext = %s\nFormat Type = %d\nCode Page = %d\n"),
m_pRasterDoc->GetFileFormatInfo ()->FormatName,
m_pRasterDoc->GetFileFormatInfo ()->DLLName,
m_pRasterDoc->GetFileFormatInfo ()->ExtName,
m_pRasterDoc->GetFileFormatInfo ()-Type);

AfxMessageBox(csString);
}
}

void CSample_COMDlg::OnButton23()
{
pRasterDoc->GetOutputFileFormats ();
}


GetRecognizedCharacters Example for Visual C++ 5.0

GetRecognizedCharacters Example for C++ 5.0 and later

void CSample_COMDlg::OnButton26()
{
pRasterDoc->SpellLanguageID = LANGID_ENGLISH;
pRasterDoc->EnableSaveResultsToMemory = FALSE;
pRasterDoc->RecognitionDataFileName = "c:\\test.rdf";

int nRet = pRasterDoc->Recognize (0, 0);
if (nRet == 0)
{
ILTDocumentOptions* pDocumentOptions = NULL;
int nCharsCount;

pRasterDoc->GetRecognizedCharacters (0);
nCharsCount = pRasterDoc->RecognizedCharactersCount;

for (int i = 0; i < nCharsCount; i++)
{
if (pRasterDoc->GetRecognizedCharacter (i)->Confidence > 900)
{
short iFont = pRasterDoc->GetRecognizedCharacter(i)->Font;

iFont |= FONT_BOLD | FONT_UNDERLINE;
pRasterDoc->GetRecognizedCharacter(i)->Font = iFont;
pRasterDoc->GetRecognizedCharacter(i)->FontSize = 20;

if (pRasterDoc->GetRecognizedCharacter(i)->Flags & CHAR_ENDOFWORD == CHAR_ENDOFWORD)
{
CString csBuffer;

csBuffer.Format (TEXT("The last character in the word is available at the following position\nLeft = %d\nTop = %d\nWidth = %d\nHeight = %d\nYOffset = %d\n"),
pRasterDoc->GetRecognizedCharacter(i)->Left,
pRasterDoc->GetRecognizedCharacter(i)->Top,
pRasterDoc->GetRecognizedCharacter(i)->Width,
pRasterDoc->GetRecognizedCharacter(i)->Height,
pRasterDoc->GetRecognizedCharacter(i)->YOffset);

AfxMessageBox(csBuffer);

csBuffer.Format (TEXT("First guess char = %s\nSecond guess char = %s\nThird guess char = %s\n"),
pRasterDoc->GetRecognizedCharacter(i)->GuessCode,
pRasterDoc->GetRecognizedCharacter(i)->GuessCode2,
pRasterDoc->GetRecognizedCharacter(i)->GuessCode3);

AfxMessageBox(csBuffer);

csBuffer.Format (TEXT("First Language Id = %d\nSecond Language Id = %d\nZone Index = %d\nCell Index = %d\Space = %d\nSpace Error = %d\n"),
pRasterDoc->GetRecognizedCharacter(i)->LanguageId,
pRasterDoc->GetRecognizedCharacter(i)->LanguageId2,
pRasterDoc->GetRecognizedCharacter(i)->ZoneIndex,
pRasterDoc->GetRecognizedCharacter(i)->CellIndex,
pRasterDoc->GetRecognizedCharacter(i)->Space,
pRasterDoc->GetRecognizedCharacter(i)->SpaceErr);

AfxMessageBox(csBuffer);
}
}
}

pRasterDoc->SetRecognizedCharacters (0);
pRasterDoc->GetRecognitionResultOptions ();

pRasterDoc->GetResultOptions ()->Format = DOCRTF_WORD_2000;
pRasterDoc->GetResultOptions ()->FormatLevel = FORMATLEVEL_FULL;

pRasterDoc->GetResultOptions ()->GetDocumentOptions ()->PaperSizeMode = SELPREDEFINED;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->PaperType = PAPER_A4;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->PaperOrientation = PAPER_ORIENT_PORTRAIT;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->Color = COL_ORIGINAL;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->EnableTextInBoxes = FALSE;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->MarginLeft = 5;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->MarginTop = 5;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->MarginWidth = 200;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->MarginHeight = 200;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->EnablePageBreaks = TRUE;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->TableMethod = TM_USETABS;

pRasterDoc->SetRecognitionResultOptions ();
pRasterDoc->SaveDocument ("c:\\test.doc");
}
}


GetStatus Example for Visual C++ 5.0

GetStatus Example for C++ 5.0 and later

void CSample_COMDlg::OnButton20()
{
CString csString;
pRasterDoc->GetStatus ();

csString.Format (TEXT("Recognized Characters = %d\nRecognized Words = %d\nRejected Characters = %d\nRejected Words = %d\nRecognized Time = %d\nReading Time = %d\nPre Process time = %d\nDecomposition = %d\n"),
pRasterDoc->GetRecognizeStatus()->RecognizedCharacterCount,
pRasterDoc->GetRecognizeStatus()->RecognizedWordCount,
pRasterDoc->GetRecognizeStatus()->RejectCharacterCount,
pRasterDoc->GetRecognizeStatus()->RejectWordCount,
pRasterDoc->GetRecognizeStatus()->RecognizedTime,
pRasterDoc->GetRecognizeStatus()->ReadingTime,
pRasterDoc->GetRecognizeStatus()->PreProcessTime,
pRasterDoc->GetRecognizeStatus()->DecompositionTime);
}


GetUserDictionarySection Example for Visual C++ 5.0

GetUserDictionarySection Example for C++ 5.0 and later

void CSample_COMDlg::OnButton32()
{
CString csMsg;

csMsg.Format (TEXT("User Dictionary Name = %s\nDefault Section Name = %s\n"),
pRasterDoc->DictionaryFileName,
pRasterDoc->DictionaryDefaultSection);

AfxMessageBox(csMsg);
BOOL bState = pRasterDoc->DictionaryState;

if (bState) //Make sure that the True vaue is 1
AfxMessageBox(TEXT("The current user dictionary is changed."));
else
AfxMessageBox(TEXT("The current user dictionary is not changed."));

CString csSection = (LPCTSTR)pRasterDoc->GetUserDictionarySection (SECTION_NAME_LENGTH, TRUE);
csMsg.Format (TEXT("First Section in the current User Dictionray = %s\n"), (LPCTSTR)csSection);
AfxMessageBox(csMsg);

CString csSectionItem = (LPCTSTR)pRasterDoc->GetUserDictionarySectionItem((LPCTSTR)csSection, 512, TRUE);
csMsg.Format (TEXT("1st Section Item in the 1st section of the current User Dictionray = %s"), (LPCTSTR)csSectionItem);
AfxMessageBox(csMsg);
}


GetRecognizedWords Example for Visual C++ 5.0

GetRecognizedWords Example for C++ 5.0 and later

Private Sub TestGetRecognizedWords ()
Dim strBuffer As String
Dim wordsCount As Integer
Dim i As Integer

RasterDoc.GetRecognizedWords 0
wordsCount = RasterDoc.RecognizedWordsCount
For i = 0 To wordsCount - 1
strBuffer = "Word = " + RasterDoc.RecognizedWord(i) + Chr(13) + _
"Zone Index = " + CStr(RasterDoc.RecognizedWordZone(i)) + Chr(13) + _
"Area {" + CStr(RasterDoc.RecognizedWordLeft(i)) + _
", " + CStr(RasterDoc.RecognizedWordTop(i)) + _
", " + CStr(RasterDoc.RecognizedWordWidth(i) + RasterDoc.RecognizedWordLeft(i)) + _
", " + CStr(RasterDoc.RecognizedWordHeight(i) + RasterDoc.RecognizedWordTop(i)) + "}"
MsgBox strBuffer
Next
End Sub


GetZoneInfo Example for Visual C++ 5.0

GetZoneInfo Example for C++ 5.0 and later

void CSample_COMDlg::OnButton10()
{
ILTZoneData* pZoneData = NULL;

HRESULT hr = CoCreateInstance(CLSID_LTZoneData, NULL, CLSCTX_ALL, IID_ILTZoneData, (void**)&pZoneData);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

int nRet = pRasterDoc->GetZoneInfo (0, 0, pZoneData);
if (nRet == 0)
{
AfxMessageBox(TEXT("The engine retrieved the specified zone information successfully."));

pZoneData->FillMethod = FM_OCRA;
pZoneData->Type = ZONE_TYPE_GRAPHIC;

nRet = pRasterDoc->UpdateZone (0, 0, pZoneData);
if(nRet == 0)
AfxMessageBox(TEXT("The specified zone is updated."));
}

pZoneData->Release();
}


IsCharacterEnabled Example for Visual C++ 5.0

IsCharacterEnabled Example for C++ 5.0 and later

void CSample_COMDlg::OnButton15()
{
CString csBuffer;

csBuffer.Format (TEXT("Total Select Languages = %d\n"), pRasterDoc->SelectedLanguagesCount);

for (int i=0; i<pRasterDoc->SelectedLanguagesCount; i++)
{
if (pRasterDoc->SelectedLanguages [i] == LANGID_ENGLISH)
AfxMessageBox(TEXT("English is active language"));
}

BOOL nRet = pRasterDoc->IsCharacterEnabled (L"a");
if (nRet == TRUE)
AfxMessageBox(TEXT("The specified character is available in the selected languages."));
else
AfxMessageBox(TEXT("The specified character is not available in the selected languages."));
}


MarkOptions Example for Visual C++ 5.0

MarkOptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton37()
{
pRasterDoc->GetRecognitionResultOptions ();

pRasterDoc->GetResultOptions ()->GetMarkOptions ()->ColorSuspectCharacter = COL_BW;
pRasterDoc->GetResultOptions()->GetMarkOptions ()->ColRejectionSymbol = COL_BW | COL_GRAY;
pRasterDoc->GetResultOptions()->GetMarkOptions ()->ColMissingSymbol = COL_NONEGR;
pRasterDoc->GetResultOptions ()->GetMarkOptions ()->ColSuspectWord = COL_ORIGINAL;

pRasterDoc->SetRecognitionResultOptions ();

CString csBuffer;

csBuffer.Format (TEXT("Separator Before Suspect Character = %s\nSeparator Before Rejection Symbol = %s\nSeparator Before Missing Symbol = %s\nSeparator Start Suspect Word = %s\nSeparator End Suspect Word = %s\nSeparator Start Line = %s\nSeparator End Line = %s\nSeparator Start Table Row = %s\nSeparator End Table Row = %s\nSeparator Start Paragraph = %s\nSeparator End Paragraph = %s\nSeparator Start Zone = %s\nSeparator End Zone = %s\nSeparator Start Page = %s\nSeparator End Page = %s\n"),
pRasterDoc->GetResultOptions ()->GetMarkOptions ()->SeparatorBeforeSuspectCharacter,
pRasterDoc->GetResultOptions()->GetMarkOptions ()->SeparatorBeforeRejectionSymbol,
pRasterDoc->GetResultOptions()->GetMarkOptions ()->SeparatorBeforeMissingSymbol,
pRasterDoc->GetResultOptions()->GetMarkOptions ()->SeparatorStartSuspectWord,
pRasterDoc->GetResultOptions()->GetMarkOptions ()->SeparatorEndSuspectWord,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorStartLine,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorEndLine,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorStartTableRow,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorEndTableRow,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorStartParagraph,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorEndParagraph,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorStartZone,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorEndZone,
pRasterDoc->GetResultOptions()->GetMarkOptions()->SeparatorStartPage,
pRasterDoc->GetResultOptions()->GetMarkOptions ()->SeparatorEndPage);

AfxMessageBox(csBuffer);
}


MemoryRecognitionResultSize Example for Visual C++ 5.0

MemoryRecognitionResultSize Example for C++ 5.0 and later

void CSample_COMDlg::OnButton21()
{
pRasterDoc->EnableSaveResultsToMemory = TRUE;
pRasterDoc->RecognitionDataFileName = "c:\\testrdf.rdf";
pRasterDoc->SpellLanguageID = LANGID_ENGLISH;
int nRet = pRasterDoc->Recognize (0, 1);

if (nRet == 0)
{
nRet = pRasterDoc->SaveResultsToMemory ();
if (nRet == 0)
{
CString csResult;

csResult.Format (TEXT("Recognition Result Size = %d"), pRasterDoc->MemoryRecognitionResultSize);
AfxMessageBox(csResult);

csResult.Format (TEXT("Recognition Result = %s"), pRasterDoc->MemoryRecognitionResult);
AfxMessageBox(csResult);
}
else
AfxMessageBox(TEXT("Failed to save results to memory."));
}
}


MOREnableFax Example for Visual C++ 5.0

MOREnableFax Example for C++ 5.0 and later

void CSample_COMDlg::OnButton17()
{
if (!pRasterDoc->MOREnableFax)
pRasterDoc->MOREnableFax = TRUE;
}


OffsetZones Example for Visual C++ 5.0

OffsetZones Example for C++ 5.0 and later

void CSample_COMDlg::OnButton28()
{
CClientDC * pDc = new CClientDC(this);

pRasterDoc->DrawPersistence = FALSE;
pRasterDoc.OffsetZones(0, 0);
int nRet = pRasterDoc->SelectZoneByPoint(NULL, (long)pDc->m_hDC, 0, 100, 100);
if (nRet == 0)
{
CString csString;
csString.Format (TEXT("The selected zone index = %d\n"), pRasterDoc->SelectZoneIndex);
AfxMessageBox(csString);
}
}


PageWidth Example for Visual C++ 5.0

PageWidth Example for C++ 5.0 and later

void CSample_COMDlg::OnButton6()
{
CString csBuffer;

int nBitsPerPixel = pRasterDoc->PageBitsPerPixel [0];
int nPageWidth = pRasterDoc->PageWidth [0];
int nPageHeight = pRasterDoc->PageHeight [0];

csBuffer.Format (TEXT("Page Width = %d\nPage Height = %d\nPage Bits Per Pixel = %d\n"),
nPageWidth,
nPageHeight,
nBitsPerPixel);

AfxMessageBox(csBuffer);
}


PaintZoomFactor Example for Visual C++ 5.0

PaintZoomFactor Example for C++ 5.0 and later

void CSample_COMDlg::TestPaintZoomFactor()
{
pRasterDoc->ActivePageIndex = 0;
pRasterDoc->EnableShowZones = TRUE;

pRasterDoc->PutScaleMode(SCALEMODE_PIXEL);

pRasterDoc->SourceLeft = 0;
pRasterDoc->SourceTop = 0;
pRasterDoc->SourceWidth = pRasterDoc->PageWidth [0];
pRasterDoc->SourceHeight = pRasterDoc->PageHeight [0];

pRasterDoc->SourceClipLeft = 0;
pRasterDoc->SourceClipTop = 0;
pRasterDoc->SourceClipWidth = 0;
pRasterDoc->SourceClipHeight = 0;

pRasterDoc->DestinationLeft = 0;
pRasterDoc->DestinationTop = 0;
pRasterDoc->DestinationWidth = pRasterDoc->PageWidth [0];
pRasterDoc->DestinationHeight = pRasterDoc->PageHeight [0];

pRasterDoc->DestinationClipLeft = 0;
pRasterDoc->DestinationClipTop = 0;
pRasterDoc->DestinationClipWidth = 0;
pRasterDoc->DestinationClipHeight = 0;

float fZoom = pRasterDoc->GetPaintZoomFactor(0);
if (fZoom != 100.0)
pRasterDoc->PutPaintZoomFactor(0, 100.0);

CClientDC * pDc = new CClientDC(this);

pRasterDoc->DrawPersistence = FALSE;
pRasterDoc->DrawPage (NULL, (long)pDc->m_hDC, 0);
}


ParagraphOptions Example for Visual C++ 5.0

ParagraphOptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton35()
{
pRasterDoc->GetRecognitionResultOptions ();

// Update Paragraph Options....
pRasterDoc->GetResultOptions ()->GetParagraphOptions ()->SpaceBeforeMode = SELPREDEFINED;
pRasterDoc->GetResultOptions ()->GetParagraphOptions ()->SpaceBefore = 2;
pRasterDoc->GetResultOptions ()->GetParagraphOptions ()->ParagraphIndentMode = SELPREDEFINED;
pRasterDoc->GetResultOptions()->GetParagraphOptions ()->FirstLineIndent = 2;
pRasterDoc->GetResultOptions()->GetParagraphOptions ()->LineSpacingMode = SELPREDEFINED;
pRasterDoc->GetResultOptions()->GetParagraphOptions ()->LineSpacing = LINE_SPACE_ONE;
pRasterDoc->GetResultOptions()->GetParagraphOptions ()->AlignmentMode = SELPREDEFINED;
pRasterDoc->GetResultOptions()->GetParagraphOptions ()->Alignment = ALIGN_LEFT;

pRasterDoc->SetRecognitionResultOptions ();
}


RemoveItemFromUserDictionary Example for Visual C++ 5.0

RemoveItemFromUserDictionary Example for C++ 5.0 and later

void CSample_COMDlg::OnButton33()
{
int nRet = pRasterDoc->RemoveItemFromUserDictionary ("cities", "Peabody");
if(nRet == 0)
{
pRasterDoc->DictionaryFileName = "USERDIC1.DIC";
pRasterDoc->DictionaryDefaultSection = "cities";

pRasterDoc->SetUserDictionary (FALSE);
}
}


RemovePage Example for Visual C++ 5.0

RemovePage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton7()
{
int nRet = pRasterDoc->RemovePage (0);
if(nRet == 0)
AfxMessageBox(TEXT("The engine deleted the specified page from the OCR document."));
else
AfxMessageBox(TEXT("The engine could not delete the specified page from the OCR document."));
}


RemoveSelectedZone Example for Visual C++ 5.0

RemoveSelectedZone Example for C++ 5.0 and later

void CSample_COMDlg::OnButton29()
{
int nRet = pRasterDoc->RemoveSelectedZone (0);
if (nRet == 0)
AfxMessageBox(TEXT("The selected zone is deleted from the zone list in the page."));
else
AfxMessageBox(TEXT("Can't delete the selected zone or there is no selected zone."));
}


RemoveZone Example for Visual C++ 5.0

RemoveZone Example for C++ 5.0 and later

void CSample_COMDlg::OnButton12()
{
int nRet = pRasterDoc->RemoveZone (0, 0);
if (nRet == 0)
AfxMessageBox(TEXT("The specified zone was deleted from the specified page."));
else
AfxMessageBox(TEXT("The engine couldn't delete the specified zone."));
}


ResultOptions Example for Visual C++ 5.0

ResultOptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton22()
{
pRasterDoc->EnableSaveResultsToMemory = FALSE;
pRasterDoc->RecognitionDataFileName = "c:\\test.rdf";
pRasterDoc->SpellLanguageID = LANGID_ENGLISH;

int nRet = pRasterDoc->Recognize (0, 1);
if (nRet == 0)
{
pRasterDoc->GetRecognitionResultOptions ();

pRasterDoc->GetResultOptions ()->Format = DOCRTF_WORD_2000;
pRasterDoc->GetResultOptions ()->FormatLevel = FORMATLEVEL_FULL;

pRasterDoc->GetResultOptions ()->GetDocumentOptions ()->PaperSizeMode = SELPREDEFINED;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->PaperType = PAPER_A4;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->MarginsMode = SELAUTO;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->LanguageMode = SELAUTO;
pRasterDoc->GetResultOptions ()->GetDocumentOptions()->ResultLanguage = LANGOUT_ENGLISH_US;

pRasterDoc->SetRecognitionResultOptions ();
nRet = pRasterDoc->SaveDocument ("c:\\test.doc");
if (nRet == 0)
AfxMessageBox(TEXT("The recognition results were saved to a file."));
}
}


SelectLanguages Example for Visual C++ 5.0

SelectLanguages Example for C++ 5.0 and later

void CSample_COMDlg::OnButton14()
{
CString csString;

pRasterDoc->ActiveLanguagesCount = 1;
pRasterDoc->ActiveLanguage [0] = LANGID_ENGLISH;

int nRet = pRasterDoc->SelectLanguages ();
if (nRet != 0)
AfxMessageBox(TEXT("Couldn't set English as the default language."));

pRasterDoc->LanguageCharacterPlus = "Test Plus";
pRasterDoc->LanguageCharacterPlusFilter = "Test Plus Filter";

if (pRasterDoc->LanguageCharacterFilter != CHAR_FILTER_ALL)
pRasterDoc->LanguageCharacterFilter = CHAR_FILTER_ALL;
}


SelectZoneByPoint Example for Visual C++ 5.0

SelectZoneByPoint Example for C++ 5.0 and later

void CSample_COMDlg::OnButton28()
{
CClientDC * pDc = new CClientDC(this);

pRasterDoc->DrawPersistence = FALSE;
int nRet = pRasterDoc->SelectZoneByPoint(NULL, (long)pDc->m_hDC, 0, 100, 100);
if (nRet == 0)
{
CString csString;
csString.Format (TEXT("The selected zone index = %d\n"), pRasterDoc->SelectZoneIndex);
AfxMessageBox(csString);
}
}


SetHandPrintOptions Example for Visual C++ 5.0

SetHandPrintOptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton18()
{
pRasterDoc->GetHandPrintOptions();

if (pRasterDoc->GetHandPrintModuleOptions ()->Style!= HANDSTYLE_US)
pRasterDoc->GetHandPrintModuleOptions ()->Style = HANDSTYLE_US;

pRasterDoc->GetHandPrintModuleOptions ()->EnableSpace = FALSE;
pRasterDoc->GetHandPrintModuleOptions ()->CharacterHeight = 6;
pRasterDoc->GetHandPrintModuleOptions ()->CharacterWidth = 4;
pRasterDoc->GetHandPrintModuleOptions ()->CharacterSpace = 1;

pRasterDoc->SetHandPrintOptions ();
}


SetOMROptions Example for Visual C++ 5.0

SetOMROptions Example for C++ 5.0 and later

void CSample_COMDlg::OnButton19()
{
pRasterDoc->GetOMROptions ();

if (!pRasterDoc->GetOMRModuleOptions ()->EnableFill)
pRasterDoc->GetOMRModuleOptions ()->EnableFill = TRUE;

if (pRasterDoc->GetOMRModuleOptions ()->Frame != OMRFRAME_YES)
pRasterDoc->GetOMRModuleOptions ()->Frame = OMRFRAME_YES;

if (pRasterDoc->GetOMRModuleOptions ()->Sense != OMRSENSE_NORMAL)
pRasterDoc->GetOMRModuleOptions ()->Sense = OMRSENSE_NORMAL;

pRasterDoc->SetOMROptions ();


SetUserDictionary Example for Visual C++ 5.0

SetUserDictionary Example for C++ 5.0 and later

void CSample_COMDlg::OnButton31()
{
int nRet = pRasterDoc->SetUserDictionary(TRUE);
if (nRet == 0)
{
pRasterDoc->AddItemToUserDictionary ("cities","Peabody");
pRasterDoc->AddItemToUserDictionary ("cities","Budapest");

pRasterDoc->DictionaryFileName = "USERDIC1.DIC";
pRasterDoc->DictionaryDefaultSection = "cities";
pRasterDoc->DictionaryItemAttribute = USER_DICT_LITERAL;

nRet = pRasterDoc->SetUserDictionary (FALSE);
if (nRet == 0)
AfxMessageBox(TEXT("The user dictionary was saved to a file."));
}
}


SpecialRejectedCharacter Example for Visual C++ 5.0

SpecialRejectedCharacter Example for C++ 5.0 and later

void CSample_COMDlg::OnButton24()
{
pRasterDoc->EnableSaveResultsToMemory = FALSE;
pRasterDoc->RecognitionDataFileName = "c:\\test.rdf";
pRasterDoc->SpellLanguageID = LANGID_ENGLISH;

int nRet = pRasterDoc->Recognize (0, 1);
if (nRet == 0)
{
if (lstrcmp(pRasterDoc->SpecialMissingSymbol, "^") != 0)
pRasterDoc->SpecialMissingSymbol = "^";

if (lstrcmp(pRasterDoc->SpecialRejectedCharacter, "!") != 0)
pRasterDoc->SpecialRejectedCharacter = "!";
}

//...
//... save recognition results using SaveDocument
//...

pRasterDoc->SaveDocument ("C:\\Ocr1.ocr");
}


StartUp Example for Visual C++ 5.0

StartUp Example for C++ 5.0 and later

void CSample_COMDlg::OnButton1()
{
ILEADRasterDocument * pRasterDoc = NULL;
ILEADRaster * pRaster = NULL;

HRESULT hr = CoCreateInstance(CLSID_LEADRasterDocument, NULL, CLSCTX_ALL, IID_ILEADRasterDocument, (void**)&pRasterDoc);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the Main LEAD Raster Object..."));
pRaster->Release();
return;
}

// Unlock OCR support.
// Note that this is a sample key, which will not work in your toolkit.
pRaster->UnlockSupport(L_SUPPORT_OCR, "TestKey");

int nRet = pRasterDoc->StartUp ();
if (nRet == 0)
{
pRasterDoc->EnableMethodErrors = FALSE;
pRasterDoc->LoadSettingsFile ("c:\\OCRsetting.set");

FILL_METHOD fm = pRasterDoc->PageFillMethod;
if (fm != FM_HANDPRINT)
pRasterDoc->PageFillMethod = FM_HANDPRINT;

nRet = pRasterDoc->SaveSettingsFile ("c:\\OCRsetting.set");
if (nRet == 0)
AfxMessageBox(TEXT("The engine saved the updated settings to a file."));
else
AfxMessageBox(TEXT("The engine couldn't save the updated settings to a file."));

pRasterDoc->ShutDown ();
}

pRasterDoc->Release();
pRaster->Release();
}


StopVerificationEventExample for Visual C++ 5.0

StopVerificationEvent Example for C++ 5.0 and later

void CSampleZoneSink::Verification(short iZoneIndex, BSTR bstrWord)
{
//...
//... Set your code here
//...
m_pZoneData->VerifyCode = VF_ACCEPT;
m_pRasterDoc->StopVerificationEvent = FALSE;
}

void CSample_COMDlg::OnButton8()
{
int nZoneCount = 0;
CString csBuffer;
ILTZoneData* pZoneData = NULL;

HRESULT hr = CoCreateInstance(CLSID_LTZoneData, NULL, CLSCTX_ALL, IID_ILTZoneData, (void**)&pZoneData);
if (FAILED(hr))
{
AfxMessageBox(TEXT("Can't instantiate the OCR COM Object..."));
return;
}

pZoneData->Left = 100;
pZoneData->Top = 100;
pZoneData->Right = 200;
pZoneData->Bottom = 200;
pZoneData->FillMethod = FM_DEFAULT;
pZoneData->RecognizeModule = RECOGNIZE_MODULE_AUTO;
pZoneData->CharacterFilter = CHAR_FILTER_DEFAULT;
pZoneData->Type = ZONE_TYPE_FLOWTEXT;
pZoneData->Flags = 0;
pZoneData->EnableVerificationEvent = TRUE;
pZoneData->SectionName = "cities";

int nRet = pRasterDoc->AddZone(0, 0, pZoneData);
if (nRet == 0)
{
CString csMsg;
csMsg.Format (TEXT("The engine added a new zone to the document successfully.\nThe Added Zone ID = %d\n"),
pZoneData->ID);
AfxMessageBox(csMsg);
}
else
AfxMessageBox(TEXT("The engine could not add a new zone to the document."));

nZoneCount = pRasterDoc->ZoneCount [0];
csBuffer.Format (TEXT("Total zones in the specified page: %d"),nZoneCount);

pZoneData->Release();
}


UpdatePage Example for Visual C++ 5.0

UpdatePage Example for C++ 5.0 and later

void CSample_COMDlg::OnButton4()
{
int nRet = pRasterDoc->UpdatePage (pRaster, 0);
if(nRet == 0)
AfxMessageBox(TEXT("The engine successfully updated the page."));
else
AfxMessageBox(TEXT("The engine could not update the page."));
}


UpdateZoneArea Example for Visual C++ 5.0

UpdateZoneArea Example for C++ 5.0 and later

void CSample_COMDlg::OnButton30()
{
CClientDC * pDc = new CClientDC(this);

pRasterDoc->DrawPersistence = FALSE;
int nRet = pRasterDoc->SelectZoneByPoint (NULL, (long)pDc->m_hDC, 0, 100, 100);
if (nRet == 0)
{
float fLeft = (float)pRasterDoc->GetSelectedZone (0)->Left;
float fTop = (float)pRasterDoc->GetSelectedZone (0) ->Top;
float fRight = (float)pRasterDoc->GetSelectedZone (0)->Right;
float fBottom = (float)pRasterDoc->GetSelectedZone (0)->Bottom;

nRet = pRasterDoc->UpdateZoneArea (0, pRasterDoc->SelectZoneIndex,
fLeft + 10,
fTop + 10,
fRight + fLeft + 50,
fBottom + fTop + 50);
if (nRet == 0)
AfxMessageBox(TEXT("The selected zone area is updated."));
}
}


ZoneLeft Example for Visual C++ 5.0

ZoneLeft Example for C++ 5.0 and later

void CSample_COMDlg::OnButton34()
{
pRasterDoc->ZoneLeft = 100;
pRasterDoc->ZoneTop = 100;
pRasterDoc->ZoneWidth = 250;
pRasterDoc->ZoneHeight = 250;

int nRet = pRasterDoc->FindZones (0, FALSE);
if(nRet == 0)
AfxMessageBox(TEXT("The engine found all available zones in the specified page."));
}


Tutorial for Builder 6.0 Programmers

Tutorial for C++ Builder 6.0 Programmers

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Working with Pages (C++ Builder 6.0)

Working with Zones (C++ Builder 6.0)

Recognize Pages (C++ Builder 6.0)

Working with Recognition Results (C++ Builder 6.0)

Painting Pages and Zones (C++ Builder 6.0)


Working with Pages (C++ Builder 6.0)

Take the following steps to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

1. | Start C++ Builder 6.0.
2. | If you didn’t import LEAD Raster Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster object library (14). Press install, and then compile and install the package dclusr.dpk.
3 | If you didn’t import LEAD Raster Process Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14). Press install, and then compile and install the package dclusr.dpk.
4. | If you didn’t import LEAD Raster OCR Document Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster OCR Document object library (14). Press install, and then compile and install the package dclusr.dpk.
5. | If you didn’t import LEAD Raster IO Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14). Press install, and then compile and install the package dclusr.dpk.
6. | From the ActiveX tab, Select and Add LEADRasterIO, LEADRasterProcess, and OCR LEADRasterDocument controls to your form.
7. | Include the following files in the "Unit1.h" file.

#include "LTRASTERLib_TLB.h"

8.

Add the following declaration to the public section of "Unit1.h":

ILEADRaster * pLEADRasterObj;

9. | Add 6 buttons to your form and name them as follows:
 | Name | Caption
 | btnStartUp | Start Up
 | btnShutDown | Shut Down
 | btnAddPage | Add Page
 | btnRemovePage | Remove Page
 | btnSetLanguages | Set Languages
 | btnFlipPage | Flip Page
10. | Code the main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
CoCreateInstance ( CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pLEADRasterObj );

if ( pLEADRasterObj == NULL )
{
ShowMessage ( "Error Creating LEAD Raster Object" );
Application->Terminate ( );
}
}

11.

Code the main form's Close procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if ( pLEADRasterObj )
{
pLEADRasterObj->Release ( );
pLEADRasterObj= NULL;
}
}

12.

Code the btnStartUp button's click procedure as follows:

void __fastcall TForm1::btnStartUpClick(TObject *Sender)
{
//notice the OCR key is a test key.
pLEADRasterObj->UnlockSupport ( L_SUPPORT_OCR, AnsiToOLESTR("TestKey") );
LEADRasterDocument1->StartUp ( );
}

13.

Code the btnShutDown button's click procedure as follows:

void __fastcall TForm1::btnShutDownClick(TObject *Sender)
{
LEADRasterDocument1->ShutDown( );
}

14.

Code the btnAddPage button's click procedure as follows:

void __fastcall TForm1::btnAddPageClick(TObject *Sender)
{
int nRet;
int nPageNumber= 0;

nRet= LEADRasterIO1->Load ( pLEADRasterObj, AnsiToOLESTR("c:\\OCRTEST.gif"), 0, 0, 1 );

if ( nRet != 0 )
ShowMessage ( "Error loading file" );

nRet= LEADRasterDocument1->AddPage ( pLEADRasterObj, nPageNumber );
if ( nRet == 0 )
{
ShowMessage ( "Page Width = " + IntToStr(LEADRasterDocument1->PageWidth [nPageNumber]) + "\n" +
"Page Height = " + IntToStr(LEADRasterDocument1->PageHeight [nPageNumber]) + "\n" +
"Page Bits Per Pixel = " + IntToStr(LEADRasterDocument1->PageBitsPerPixel [nPageNumber]));
}
else
ShowMessage ( "The engine could not add a new page to the Document" );
}

15.

Code the btnRemovePage button's click procedure as follows:

void __fastcall TForm1::btnRemovePageClick(TObject *Sender)
{
int i;
int nRet;
int nPageCount;

nPageCount= LEADRasterDocument1->PageCount;
for ( i= 0; i < nPageCount; i ++ )
{
nRet= LEADRasterDocument1->RemovePage (i);
if ( nRet == 0 )
ShowMessage ( "The page # " + IntToStr(i) + "is removed successfully" );
}
}

16.

Code the btnSetLanguages button's click procedure as follows:

void __fastcall TForm1::btnSetLanguagesClick(TObject *Sender)
{
int nRet;

LEADRasterDocument1->set_ActiveLanguagesCount ( 1 );
LEADRasterDocument1->set_ActiveLanguage ( 0, LANGID_ENGLISH );
nRet= LEADRasterDocument1->SelectLanguages ();
if ( nRet != 0 )
ShowMessage ( "Error " + IntToStr(nRet) + "Setting English as default language" );
else
ShowMessage ( "English is Set as the active language" );
}

17.

Code the btnFlipPage button's click procedure as follows:

void __fastcall TForm1::btnFlipPageClick(TObject *Sender)
{
int nRet;
LEADRasterDocument1->ExportPage ( pLEADRasterObj, 0 );
LEADRasterProcess1->Flip ( pLEADRasterObj );
nRet= LEADRasterDocument1->UpdatePage ( pLEADRasterObj, 0 );
if ( nRet == 0 )
ShowMessage ( "The specified page is updated successfuly" );
else
ShowMessage ( "Error " + IntToStr(nRet) + " in updating page bitmap for page # 0" );
LEADRasterDocument1->set_ActivePageIndex ( 0 );
}

18. | Run your program to test it.
19. | Save the project to use as a starting point for other tasks in this tutorial.


Working with Zones (C++ Builder 6.0)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages
2. | From the ActiveX tab, Select and Add LTZoneData control to your form.
3. | Add 3 buttons to your form and name them as follows:
 | Name | Caption
 | btnFindZones | Find Zones
 | btnZonesCount | Zones Count
 | btnVerifyZone | Verify Zone
4. | Handle the LTZoneData OnVerification event, and code the LTZoneData1Verification procedure as follows:

void __fastcall TForm1::LTZoneData1Verification(TObject *Sender,
short iZoneIndex, BSTR bstrWord)
{
LTZoneData1->set_VerifyCode ( VF_ACCEPT );
LTZoneData1->set_StopVerificationEvent ( False );
}

5.

Code the btnFindZones button's click procedure as follows:

void __fastcall TForm1::btnFindZonesClick(TObject *Sender)
{
int nRet;

LEADRasterDocument1->GetAutoZoneOptions ( );
LEADRasterDocument1->set_EnableZoneForceSingleColumn( True );
LEADRasterDocument1->set_ShowZoneGridLines( True );

LEADRasterDocument1->SetAutoZoneOptions ( );
nRet= LEADRasterDocument1->FindZones ( 0, True );
if ( nRet == 0 )
ShowMessage ( "Automatic zones method finds all available zones into the specified pages successfully" );
else
ShowMessage ( "Error" + IntToStr(nRet) + "in finding available zone in the specified page" );
}

6.

Code the btnZonesCount button's click procedure as follows:

void __fastcall TForm1::btnZonesCountClick(TObject *Sender)
{
int nZoneCount;

nZoneCount= LEADRasterDocument1->ZoneCount [0];
ShowMessage ( "Total Zones count = " + IntToStr(nZoneCount) );
}

7.

Code the btnVerifyZone button's click procedure as follows:

void __fastcall TForm1::btnVerifyZoneClick(TObject *Sender)
{
int i;
int nRet;
int nZoneCount;

nZoneCount= LEADRasterDocument1->ZoneCount [0];
for ( i= 0; i < nZoneCount; i ++ )
{
nRet= LEADRasterDocument1->GetZoneInfo ( 0, i, LTZoneData1->GetDefaultInterface ( ) );
if ( nRet == 0 )
{
if ((LTZoneData1->Flags & ZONE_CHK_CHECKCBF_PROHIBIT) == ZONE_CHK_CHECKCBF_PROHIBIT)
{
LTZoneData1->set_Flags( LTZoneData1->Flags & (! ZONE_CHK_CHECKCBF_PROHIBIT));
}

LTZoneData1->set_EnableVerificationEvent( True );
nRet= LEADRasterDocument1->UpdateZone ( 0, i, LTZoneData1->GetDefaultInterface ( ));
if ( nRet != 0 )
ShowMessage ( "Error" + IntToStr(nRet) + "in updating zone # " + IntToStr(i) );
}
}
}

8. | Run your program to test it.
9. | Save the project to use as a starting point for other tasks in this tutorial.


Recognize Pages (C++ Builder 6.0)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnRecognize | Recognize
 | btnGetStatus | Get Status
3. | Handle the LEADRasterDocument1 OnRecognitionStatus event, and code the LEADRasterDocument1RecognitionStatus procedure as follows:

void __fastcall TForm1::LEADRasterDocument1RecognitionStatus(
TObject *Sender, short iRecogPage, short iError)
{
ShowMessage ( "The page # " + IntToStr(iRecogPage) + "is finished its recognition\n" +
"The recognition return code = " + IntToStr(iError) );
//continue to recognize next page"
LEADRasterDocument1->set_EnableStopRecognizeStatus ( False );
}

4.

Code the btnRecognize button's click procedure as follows:

void __fastcall TForm1::btnRecognizeClick(TObject *Sender)
{
int nRet;

LEADRasterDocument1->set_SpellLanguageID( LANGID_ENGLISH );
LEADRasterDocument1->set_EnableSubSystem( True );
LEADRasterDocument1->set_EnableCorrection ( True );

LEADRasterDocument1->set_RecognitionDataFileName ( AnsiToOLESTR("c:\\testrdf.rdf") );

nRet= LEADRasterDocument1->Recognize ( 0, 1 );
if ( nRet == 0 )
ShowMessage ( "The engine finished recognizing the specified pages successfully" );
else
ShowMessage ( "Error" + IntToStr(nRet) + "in recognized specified pages" );
}

5.

Code the btnGetStatus button's click procedure as follows:

void __fastcall TForm1::btnGetStatusClick(TObject *Sender)
{
int nRet;

nRet= LEADRasterDocument1->GetStatus ( );
if ( nRet == 0 )
{
ShowMessage ( "Recognition Time = " + IntToStr(LEADRasterDocument1->RecognizeStatus->RecognizedTime) + "\n" +
"Total Recognized Characters = " + IntToStr(LEADRasterDocument1->RecognizeStatus->RecognizedCharacterCount) + "\n" +
"Total Recognized Words = " + IntToStr(LEADRasterDocument1->RecognizeStatus->RecognizedWordCount) + "\n" +
"Total Rejected Characters = " + IntToStr(LEADRasterDocument1->RecognizeStatus->RejectCharacterCount) + "\n" +
"Total Rejected Words = " + IntToStr(LEADRasterDocument1->RecognizeStatus->RejectWordCount) );
}
}

6. | Run your program to test it.
7. | Save the project to use as a starting point for other tasks in this tutorial.


Working with Recognition Results (C++ Builder 6.0)

Take the following steps to add code to the existing project that will let you work with Recognition options:

1. | Start with the program you created in Working with Zones
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnGetOutputFormat | Get Output Format
 | btnSaveDocument | Save Document
3. | Handle the LEADRasterDocument1 OnEnumOutputFileFormats event, and code the LEADRasterDocument1EnumOutputFileFormats procedure as follows:

void __fastcall TForm1::LEADRasterDocument1EnumOutputFileFormats(
TObject *Sender, FORMATTYPE Format)
{
int nRet;
AnsiString Msg;

nRet= LEADRasterDocument1->GetFileFormatInfo ( Format );
if ( nRet == 0 )
{
Msg= "Format Name = ";
Msg= Msg + LEADRasterDocument1->FileFormatInfo->FormatName + "\n";
Msg= Msg + "Format DLL Name = ";
Msg= Msg + LEADRasterDocument1->FileFormatInfo->DLLName+ "\n";
Msg= Msg + "Format Ext Name = ";
Msg= Msg + LEADRasterDocument1->FileFormatInfo->ExtName;

ShowMessage ( Msg );

switch ( LEADRasterDocument1->FileFormatInfo->Type)
{
case OUTTYPE_PLAIN:
ShowMessage ( "Format Type = Plain" );
break;

case OUTTYPE_WORD_PROCESSOR:
ShowMessage ( "Format Type = Word Processor" );
break;

case OUTTYPE_TRUE_WORD_PROCESSOR:
ShowMessage ( "Format Type = True Word Processor" );
break;

case OUTTYPE_TABLE:
ShowMessage ( "Format Type = Table" );
break;

case OUTTYPE_UNKNOWN:
ShowMessage ( "Format Type = Unknown" );
break;
}
}
}

4.

Code the btnGetOutputFormat button's click procedure as follows:

void __fastcall TForm1::btnGetOutputFormatClick(TObject *Sender)
{
int nRet;

nRet= LEADRasterDocument1->GetOutputFileFormats ( );
if ( nRet != 0 )
ShowMessage ( "Error" + IntToStr(nRet) + "in enumerating available file formats" );
}

5.

Code the btnSaveDocument button's click procedure as follows:

void __fastcall TForm1::btnSaveDocumentClick(TObject *Sender)
{
int nRet;

nRet= LEADRasterDocument1->GetRecognitionResultOptions ( );
if ( nRet == 0 )
{
LEADRasterDocument1->ResultOptions->FormatLevel= FORMATLEVEL_FULL;
LEADRasterDocument1->ResultOptions->DocumentOptions->PaperSizeMode= SELPREDEFINED;
LEADRasterDocument1->ResultOptions->DocumentOptions->PaperType= PAPER_A4;
}

LEADRasterDocument1->SetRecognitionResultOptions ( );
nRet= LEADRasterDocument1->SaveDocument ( AnsiToOLESTR("c:\\test.doc") );
if ( nRet != 0 )
ShowMessage ( "Error" + IntToStr(nRet) + "in saving recognition result to a file" );
}

6. | Run your program to test it.
7. | Save the project to use as a starting point for other tasks in this tutorial.


Painting Pages and Zones (C++ Builder 6.0)

Take the following steps to add code to the existing project that will let you paint pages and zones:

1. | Start with the program you created in Working with Pages
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnDrawZones | Draw Zones
 | btnDrawPage | Draw Page
3. | Add the following declaration to the public section of "Unit1.h":
 | bool bDrawPage; bool bDrawZones;
4. | Update the FormCreate procedure to be as follows:

void __fastcall TForm1::FormCreate(TObject *Sender)
{
CoCreateInstance ( CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pLEADRasterObj );

if ( pLEADRasterObj == NULL )
{
ShowMessage ( "Error Creating LEAD Raster Object" );
Application->Terminate ( );
}
bDrawPage= False;
bDrawZones= False;
}

5.

Update the btnAddPageClick procedure to be as follows:

void __fastcall TForm1::btnAddPageClick(TObject *Sender)
{
int nRet;
int nPageNumber= 0;

nRet= LEADRasterIO1->Load ( pLEADRasterObj, AnsiToOLESTR("c:\\OCRTEST.gif"), 0, 0, 1 );

if ( nRet != 0 )
ShowMessage ( "Error loading file" );

nRet= LEADRasterDocument1->AddPage ( pLEADRasterObj, nPageNumber );

bDrawPage= False;
LEADRasterDocument1->set_ActivePageIndex ( 0 );
bDrawPage= True;

if ( nRet == 0 )
{
ShowMessage ( "Page Width = " + IntToStr(LEADRasterDocument1->PageWidth [nPageNumber]) + "\n" +
"Page Height = " + IntToStr(LEADRasterDocument1->PageHeight [nPageNumber]) + "\n" +
"Page Bits Per Pixel = " + IntToStr(LEADRasterDocument1->PageBitsPerPixel [nPageNumber]));
}
else
ShowMessage ( "The engine could not add a new page to the Document" );
}

6.

Code the btnDrawZones button's click procedure as follows:

void __fastcall TForm1::btnDrawZonesClick(TObject *Sender)
{
bDrawZones= ! bDrawZones;
}

7.

Code the btnDrawPage button's click procedure as follows:

void __fastcall TForm1::btnDrawPageClick(TObject *Sender)
{
if ( bDrawPage )
{
LEADRasterDocument1->set_EnableShowZones ( bDrawZones );
LEADRasterDocument1->set_DrawPersistence ( False );
LEADRasterDocument1->DrawPage( NULL, (long)this->Canvas->Handle, 0 );
}
}

8.

Run your program to test it.


Tutorial for Delphi 6.0 Programmers

LEADTOOLS OCR COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Working with Pages (Delphi 6.0)

Working with Zones (Delphi 6.0)

Recognize Pages (Delphi 6.0)

Working with Recognition Results (Delphi 6.0)

Painting Pages and Zones (Delphi 6.0)


Working with Pages (Delphi 6.0)

Take the following steps to create and run a program that shows how to work with pages in an OCR document. Remember, the purpose of the tutorials is to provide you with a quick and easy way to generate an OCR program.

1. | Start Delphi 6.0.
2. | If you didn’t import LEAD Raster Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster object library (14). Press install, and then compile and install the package dclusr.dpk.
3 | If you didn’t import LEAD Raster Process Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14). Press install, and then compile and install the package dclusr.dpk.
4. | If you didn’t import LEAD Raster OCR Document Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster OCR Document object library (14). Press install, and then compile and install the package dclusr.dpk.
5. | If you didn’t import LEAD Raster IO Object before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14). Press install, and then compile and install the package dclusr.dpk.
6. | From the ActiveX tab, Select and Add LEADRasterIO, LEADRasterProcess, and OCR LEADRasterDocument controls to your form.
7. | At the beginning of the Unit1 file, add ‘LTRASTERLib_TLB’, ‘ActiveX’ and ‘ComObj’ units to the uses section.
8. | Declare the following variable in the public section of Unit1.

LEADRasterObj: LEADRaster;

9. | Add 6 buttons to your form and name them as follows:
 | Name | Caption
 | btnStartUp | Start Up
 | btnShutDown | Shut Down
 | btnAddPage | Add Page
 | btnRemovePage | Remove Page
 | btnSetLanguages | Set Languages
 | btnFlipPage | Flip Page
10. | Code the main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormCreate(Sender: TObject);
begin
LEADRasterObj:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
if ( LEADRasterObj = Nil ) then
begin
ShowMessage ( 'Error Creating LEAD Raster Object' );
Application.Terminate ( );
end;
end;

11.

Code the btnStartUp button's click procedure as follows:

procedure TForm1.btnStartUpClick(Sender: TObject);
begin
//notice the OCR key is a test key.
LEADRasterObj.UnlockSupport ( L_SUPPORT_OCR, 'TestKey' );
LEADRasterDocument1.StartUp ( );
end;

12.

Code the btnShutDown button's click procedure as follows:

procedure TForm1.btnShutDownClick(Sender: TObject);
begin
LEADRasterDocument1.ShutDown ( );
end;

13.

Code the btnAddPage button's click procedure as follows:

procedure TForm1.btnAddPageClick(Sender: TObject);
var
nRet: Integer;
nPageNumber: Integer;
begin
nPageNumber:= 0;
nRet:= LEADRasterIO1.Load ( LEADRasterObj, 'c:\OCRTEST.gif', 0, 0, 1 );

if ( nRet <> 0 ) then
ShowMessage ( 'Error loading file' );

nRet:= LEADRasterDocument1.AddPage ( LEADRasterObj, nPageNumber );
if ( nRet = 0 ) then
begin
ShowMessage ( 'Page Width = ' + IntToStr(LEADRasterDocument1.PageWidth [nPageNumber]) + Chr(13) +
'Page Height = ' + IntToStr(LEADRasterDocument1.PageHeight [nPageNumber]) + Chr(13) +
'Page Bits Per Pixel = ' + IntToStr(LEADRasterDocument1.PageBitsPerPixel [nPageNumber]));
end
else
ShowMessage ( 'The engine could not add a new page to the Document' );
end;

14.

Code the btnRemovePage button's click procedure as follows:

procedure TForm1.btnRemovePageClick(Sender: TObject);
var
i: Integer;
nRet: Integer;
nPageCount: Integer;
begin
nPageCount:= LEADRasterDocument1.PageCount;
For i:= 0 to nPageCount - 1 do
begin
nRet:= LEADRasterDocument1.RemovePage (i);
if ( nRet = 0 ) then
ShowMessage ( 'The page # ' + IntToStr(i) + 'is removed successfully' );
end;
end;

15.

Code the btnSetLanguages button's click procedure as follows:

procedure TForm1.btnSetLanguagesClick(Sender: TObject);
var
nRet: Integer;
begin
LEADRasterDocument1.ActiveLanguagesCount:= 1;
LEADRasterDocument1.ActiveLanguage [0]:= LANGID_ENGLISH;
nRet:= LEADRasterDocument1.SelectLanguages ();
if ( nRet <> 0 ) Then
ShowMessage ( 'Error ' + IntToStr(nRet) + 'Setting English as default language' )
else
ShowMessage ( 'English is Set as the active language' );
end;

16.

Code the btnFlipPage button's click procedure as follows:

procedure TForm1.btnFlipPageClick(Sender: TObject);
var
nRet: Integer;
begin
LEADRasterDocument1.ExportPage ( LEADRasterObj, 0 );
LEADRasterProcess1.Flip ( LEADRasterObj );
nRet:= LEADRasterDocument1.UpdatePage ( LEADRasterObj, 0 );
if ( nRet = 0 ) then
ShowMessage ( 'The specified page is updated successfuly' )
else
ShowMessage ( 'Error ' + IntToStr(nRet) + ' in updating page bitmap for page # 0' );
LEADRasterDocument1.ActivePageIndex:= 0;
end;

17. | Run your program to test it.
18. | Save the project to use as a starting point for other tasks in this tutorial.


Working with Zones (Delphi 6.0)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Pages
2. | From the ActiveX tab, Select and Add LTZoneData control to your form.
3. | Add three buttons to your form and name them as follows:
 | Name | Caption
 | btnFindZones | Find Zones
 | btnZonesCount | Zones Count
 | btnVerifyZone | Verify Zone
4. | Handle the LTZoneData OnVerification event, and code the LTZoneData1Verification procedure as follows:

procedure TForm1.LTZoneData1Verification(ASender: TObject;
iZoneIndex: Smallint; const bstrWord: WideString);
begin
LTZoneData1.VerifyCode:= VF_ACCEPT;
LTZoneData1.StopVerificationEvent:= False;
end;

5.

Code the btnFindZones button's click procedure as follows:

procedure TForm1.btnFindZonesClick(Sender: TObject);
var
nRet: Integer;
begin
LEADRasterDocument1.GetAutoZoneOptions ( );
LEADRasterDocument1.EnableZoneForceSingleColumn:= True;
LEADRasterDocument1.ShowZoneGridLines:= True;

LEADRasterDocument1.SetAutoZoneOptions ( );
nRet:= LEADRasterDocument1.FindZones ( 0, True );
if ( nRet = 0 ) then
ShowMessage ( 'Automatic zones method finds all available zones into the specified pages successfully' )
else
ShowMessage ( 'Error' + IntToStr(nRet) + 'in finding available zone in the specified page' );
end;

6.

Code the btnZonesCount button's click procedure as follows:

procedure TForm1.btnZonesCountClick(Sender: TObject);
var
nZoneCount: Integer;
begin
nZoneCount:= LEADRasterDocument1.ZoneCount [0];
ShowMessage ( 'Total Zones count = ' + IntToStr(nZoneCount) );
end;

7.

Code the btnVerifyZone button's click procedure as follows:

procedure TForm1.btnVerifyZoneClick(Sender: TObject);
var
i: Integer;
nRet: Integer;
nZoneCount: Integer;
begin
nZoneCount:= LEADRasterDocument1.ZoneCount [0];
for i:= 0 to nZoneCount -1 do
begin
nRet:= LEADRasterDocument1.GetZoneInfo ( 0, i, LTZoneData1.DefaultInterface );
if ( nRet = 0 ) then
begin
if ((LTZoneData1.Flags And ZONE_CHK_CHECKCBF_PROHIBIT) = ZONE_CHK_CHECKCBF_PROHIBIT) Then
begin
LTZoneData1.Flags:= LTZoneData1.Flags And (Not ZONE_CHK_CHECKCBF_PROHIBIT);
end;

LTZoneData1.EnableVerificationEvent:= True;
nRet:= LEADRasterDocument1.UpdateZone ( 0, i, LTZoneData1.DefaultInterface );
if ( nRet <> 0 ) then
ShowMessage ( 'Error' + IntToStr(nRet) + 'in updating zone # ' + IntToStr(i) );
end;
end;
end;

8. | Run your program to test it.
9. | Save the project to use as a starting point for other tasks in this tutorial.


Recognize Pages (Delphi 6.0)

Take the following steps to add code to the existing project that will let you recognize pages:

1. | Start with the program you created in Working with Zones
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnRecognize | Recognize
 | btnGetStatus | Get Status
3. | Handle the LEADRasterDocument1 OnRecognitionStatus event, and code the LEADRasterDocument1RecognitionStatus procedure as follows:

procedure TForm1.LEADRasterDocument1RecognitionStatus(ASender: TObject;
iRecogPage, iError: Smallint);
begin
ShowMessage ( 'The page # ' + IntToStr(iRecogPage) + 'is finished its recognition' + Chr(13) +
'The recognition return code = ' + IntToStr(iError) );
//continue to recognize next page'
LEADRasterDocument1.EnableStopRecognizeStatus:= False;
end;

4.

Code the btnRecognize button's click procedure as follows:

procedure TForm1.btnRecognizeClick(Sender: TObject);
var
nRet: Integer;
begin
LEADRasterDocument1.SpellLanguageID:= LANGID_ENGLISH;
LEADRasterDocument1.EnableSubSystem:= True;
LEADRasterDocument1.EnableCorrection:= True;

LEADRasterDocument1.RecognitionDataFileName:= 'c:\testrdf.rdf';

nRet:= LEADRasterDocument1.Recognize ( 0, 1 );
if ( nRet = 0 ) then
ShowMessage ( 'The engine finished recognizing the specified pages successfully' )
else
ShowMessage ( 'Error' + IntToStr(nRet) + 'in recognized specified pages' );
end;

5.

Code the btnGetStatus button's click procedure as follows:

procedure TForm1.btnGetStatusClick(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADRasterDocument1.GetStatus ( );
if ( nRet = 0 ) then
begin
ShowMessage ( 'Recognition Time = ' + IntToStr(LEADRasterDocument1.RecognizeStatus.RecognizedTime) + Chr(13) +
'Total Recognized Characters = ' + IntToStr(LEADRasterDocument1.RecognizeStatus.RecognizedCharacterCount) + Chr(13) +
'Total Recognized Words = ' + IntToStr(LEADRasterDocument1.RecognizeStatus.RecognizedWordCount) + Chr(13) +
'Total Rejected Characters = ' + IntToStr(LEADRasterDocument1.RecognizeStatus.RejectCharacterCount) + Chr(13) +
'Total Rejected Words = ' + IntToStr(LEADRasterDocument1.RecognizeStatus.RejectWordCount) );
end;
end;

6. | Run your program to test it.
7. | Save the project to use as a starting point for other tasks in this tutorial.


Working with Recognition Results (Delphi 6.0)

Take the following steps to add code to the existing project that will let you work with Recognition options:

1. | Start with the program you created in Working with Zones
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnGetOutputFormat | Get Output Format
 | btnSaveDocument | Save Document
3. | Handle the LEADRasterDocument1 OnEnumOutputFileFormats event, and code the LEADRasterDocument1EnumOutputFileFormats procedure as follows:

procedure TForm1.LEADRasterDocument1EnumOutputFileFormats(ASender: TObject;
Format: TOleEnum);
var
nRet: Integer;
begin
nRet:= LEADRasterDocument1.GetFileFormatInfo ( Format );
if ( nRet = 0 ) then
begin
ShowMessage ( 'Format Name = ' + LEADRasterDocument1.FileFormatInfo.FormatName + Chr(13) +
'Format DLL Name = ' + LEADRasterDocument1.FileFormatInfo.DLLName + Chr(13) +
'Format Ext Name = ' + LEADRasterDocument1.FileFormatInfo.ExtName );

Case ( LEADRasterDocument1.FileFormatInfo.Type_ ) of
OUTTYPE_PLAIN:
ShowMessage ( 'Format Type = Plain' );

OUTTYPE_WORD_PROCESSOR:
ShowMessage ( 'Format Type = Word Processor' );

OUTTYPE_TRUE_WORD_PROCESSOR:
ShowMessage ( 'Format Type = True Word Processor' );

OUTTYPE_TABLE:
ShowMessage ( 'Format Type = Table' );

OUTTYPE_UNKNOWN:
ShowMessage ( 'Format Type = Unknown' );
end;
end;
end;

4.

Code the btnGetOutputFormat button's click procedure as follows:

procedure TForm1.btnGetOutputFormatClick(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADRasterDocument1.GetOutputFileFormats ( );
if ( nRet <> 0 ) then
ShowMessage ( 'Error' + IntToStr(nRet) + 'in enumerating available file formats' );
end;

5.

Code the btnSaveDocument button's click procedure as follows:

procedure TForm1.btnSaveDocumentClick(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADRasterDocument1.GetRecognitionResultOptions ( );
if ( nRet = 0 ) then
begin
LEADRasterDocument1.ResultOptions.FormatLevel:= FORMATLEVEL_FULL;
LEADRasterDocument1.ResultOptions.DocumentOptions.PaperSizeMode:= SELPREDEFINED;
LEADRasterDocument1.ResultOptions.DocumentOptions.PaperType:= PAPER_A4;
end;

LEADRasterDocument1.SetRecognitionResultOptions ( );
nRet:= LEADRasterDocument1.SaveDocument ( 'c:\test.doc' );
if ( nRet <> 0 ) then
ShowMessage ( 'Error' + IntToStr(nRet) + 'in saving recognition result to a file' );
end;

6. | Run your program to test it.
7. | Save the project to use as a starting point for other tasks in this tutorial.


Painting Pages and Zones (Delphi 6.0)

Take the following steps to add code to the existing project that will let you paint pages and zones:

1. | Start with the program you created in Working with Pages
2. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnDrawZones | Draw Zones
 | btnDrawPage | Draw Page
3. | Declare the following variables in the public section of Unit1.

bDrawPage: Boolean;
bDrawZones: Boolean;

4.

Update the FormCreate procedure to be as follows:

procedure TForm1.FormCreate(Sender: TObject);
begin
LEADRasterObj:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
bDrawPage:= False;
bDrawZones:= False;
end;

5.

Update the btnAddPageClick procedure to be as follows:

procedure TForm1.btnAddPageClick(Sender: TObject);
var
nRet: Integer;
nPageNumber: Integer;
begin
nPageNumber:= 0;
nRet:= LEADRasterIO1.Load ( LEADRasterObj, 'c:\OCRTEST.gif', 0, 0, 1 );

if ( nRet <> 0 ) then
ShowMessage ( 'Error loading file' );

nRet:= LEADRasterDocument1.AddPage ( LEADRasterObj, nPageNumber );

bDrawPage:= False;
LEADRasterDocument1.ActivePageIndex:= 0;
bDrawPage:= True;

if ( nRet = 0 ) then
begin
ShowMessage ( 'Page Width = ' + IntToStr(LEADRasterDocument1.PageWidth [nPageNumber]) + Chr(13) +
'Page Height = ' + IntToStr(LEADRasterDocument1.PageHeight [nPageNumber]) + Chr(13) +
'Page Bits Per Pixel = ' + IntToStr(LEADRasterDocument1.PageBitsPerPixel [nPageNumber]));
end
else
ShowMessage ( 'The engine could not add a new page to the Document' );
end;

6.

Code the btnDrawZones button's click procedure as follows:

procedure TForm1.btnDrawZonesClick(Sender: TObject);
begin
bDrawZones:= Not bDrawZones;
end;

7.

Code the btnDrawPage button's click procedure as follows:

procedure TForm1.btnDrawPageClick(Sender: TObject);
begin
if ( bDrawPage = True ) then
begin
LEADRasterDocument1.EnableShowZones:= bDrawZones;
LEADRasterDocument1.DrawPersistence:= False;
LEADRasterDocument1.DrawPage ( Nil, Self.Canvas.Handle, 0 );
end;
end;

8.

Run your program to test it.


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Atten: Technical Support
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Before calling technical support, please look in the online documentation and the example programs for an answer to your question.


Properties, Methods, and Events

By class or interface:

ILEADRasterDocument

ILTZoneData

ILTHandPrintOptions

ILTOMROptions

ILTRecognizeStatus

ILTDocumentOptions

ILTParagraphOptions

ILTCharacterOptions

ILTMarkOptions

ILTResultOptions

ILTFileFormatInfo

ILTRecognizedCharacters

By functionality:

Quick Reference OCR: Starting and Shutting Down the Engine

Quick Reference OCR: Working with Pages

Quick Reference OCR: Working with Zones

Quick Reference OCR: Using the ILTZoneData Properties

Quick Reference OCR: Using the HandPrint Options

Quick Reference OCR: Using the OMR Options

Quick Reference OCR: Getting Status Updates

Quick Reference OCR: Handling the Results of the Recognitiona Process

Quick Reference OCR: Using the Document Options

Quick Reference OCR: Using the Paragraph Options

Quick Reference OCR: Using the Character Options

Quick Reference OCR: Using the Mark Options

Quick Reference OCR: Working with Languages

Quick Reference OCR: Working with a Dictionary

Quick Reference OCR: Recognizing Document Pages

Quick Reference OCR: Using Recognized Characters

Quick Reference OCR: Drawing Pages and Zones

Quick Reference OCR: Working with Recognized Words


Quick Reference OCR: Starting and Shutting Down the Engine

Quick Reference OCR:
Starting and Shutting Down the Engine

EnableProgressStatusEvent property

LoadSettingsFile method

ProgressStatus event

SaveSettingsFile method

ShutDown method

StartUp method

StopProgressStatusEvent property


Quick Reference OCR: Working with Pages

Quick Reference OCR:
Working with Pages

AddPage method

AutoOrientPage method

DetectOrientationDegree property

ExportPage method

PageBitsPerPixel property

PageCount property

PageHeight property

PageWidth property

RemovePage method

UpdatePage method


Quick Reference OCR: Drawing Pages and Zones

Quick Reference OCR:
Drawing Pages and Zones

ActivePageIndex property

DestinationClipHeight property

DestinationClipLeft property

DestinationClipTop property

DestinationClipWidth property

DestinationHeight property

DestinationLeft property

DestinationTop property

DestinationWidth property

DrawPage method

DrawPersistence property

EnableShowZones property

PaintZoomFactor property

RemoveSelectedZone method

ScaleMode property

SelectedZone property

SelectedZonePenColor property

SelectedZonePenStyle property

SelectedZonePenWidth property

SelectZone method

SelectZoneByPoint method

SelectZoneIndex property

SetSelectedZonePen method

SetZonePen method

SourceClipHeight property

SourceClipLeft property

SourceClipTop property

SourceClipWidth property

SourceHeight property

SourceLeft property

SourceTop property

SourceWidth property

UpdateZoneArea method

ZonePenColor property

ZonePenStyle property

ZonePenWidth property


Quick Reference OCR: Working with Zones

Quick Reference OCR:
Working with Zones

AddZone method

DefaultPageFillMethod property

EnableParallelRecognition property

EnableZoneForceSingleColumn property

ExportZones method

FindZones method

GetAutoZoneOptions method

GetZoneInfo method

ImportZones method

PageFillMethod property

RemoveZone method

SetAutoZoneOptions method

ShowZoneGridLines property

UpdateZone method

ZoneCount property

ZoneHeight property

ZoneLeft property

ZoneParser property

ZoneTop property

ZoneWidth property


Quick Reference OCR: Using the ILTZoneData Properties

Quick Reference OCR:
Using the ILTZoneData Properties

Bottom property

CharacterFilter property

EnableVerificationEvent property

FillMethod properyt

Flags property

ID property

Left property

MOREnableFax propertys

RecognizeModule property

RecognizeModuleTradeOff property

Right property

SectionName property

StopVerificationEvent property

Top property

Type property

Verification event

VerifyCode property


Quick Reference OCR: Using the HandPrint Options

Quick Reference OCR:
Using the HandPrint Options

CharacterHeight property

CharacterSpace property

CharacterWidth property

EnableSpace property

GetHandPrintOptions method

HandPrintModuleOptions property

SetHandPrintOptions method

Style property


Quick Reference OCR: Using the OMR Options

Quick Reference OCR:
Using the OMR Options

EnableFill property

Frame property

GetOMROptions method

OMRModuleOptions property

Sense property

SetOMROptions method


Quick Reference OCR: Working with Languages

Quick Reference OCR:
Working with Languages

ActiveLanguage property

ActiveLanguagesCount property

DefaultSpellLanguages property

DefaultSpellLanguagesCount property

IsCharacterEnabled method

LanguageCharacterFilter property

LanguageCharacterPlus property

LanguageCharacterPlusFilter property

SelectLanguages method

SelectedLanguages property

SelectedLanguagesCount property


Quick Reference OCR: Working with a Dictionary

Quick Reference OCR:
Working with a Dictionary

AddItemToUserDictionary method

DictionaryDefaultSection property

DictionaryFileName property

DictionaryItemAttribute property

DictionaryState property

GetUserDictionarySection method

GetUserDictionarySectionItem method

Recognize method

RemoveItemFromUserDictionary method

SetUserDictionary method


Quick Reference OCR: Working with Recognized Words

Quick Reference OCR:
Working with Recognized Words

GetRecognizedWords method

RecognizedWord property

RecognizedWordHeight property

RecognizedWordLeft property

RecognizedWordsCount property

RecognizedWordTop property

RecognizedWordWidth property

RecognizedWordZone property


Quick Reference OCR: Recognizing Document Pages

Quick Reference OCR:
Recognizing Document Pages

EnableCorrection property

EnableFireRecognizeStatus property

EnableMethodErrors property

EnableParallelRecognition property

EnableProgressStatusEvent property

EnableStopRecognizeStatus property

EnableSubsystem property

GetRecognizedCharacters method

GetStatus method

ProgressStatus event

RecognitionStatus event

Recognize method

RecognizedCharacter property

RecognizeModuleTradeOff property

SpecialMissingSymbol property

SpecialRejectedCharacter property

SpellLanguageID property

StopProgressStatusEvent property

Verification event


Quick Reference OCR: Using Recognized Characters

Quick Reference OCR:
Using Recognized Characters

CellIndex property

Confidence property

Flags property

Font property

FontSize property

GetRecognizedCharacters method

GuessCode property

GuessCode2 property

GuessCode3 property

Height property

LanguageId property

LanguageId2 property

Left property

RecognizedCharactersCount property

RecognizedCharacter property

SetRecognizedCharacters method

Space property

SpaceErr property

Top property

Width property

YOffset property

ZoneIndex property


Quick Reference OCR: Getting Status Updates

Quick Reference OCR:
Getting Status Updates

DecompositionTime property

GetStatus method

PreProcessTime property

ReadingTime property

Recognize method

RecognizedCharacterCount property

RecognizedTime property

RecognizedWordCount property

RecognizeStatus property

RejectCharacterCount property

RejectWordCount property


Quick Reference OCR: Handling the Results of the Recognition Process

Quick Reference OCR:
Handling the Results of the Recognition Process

CharacterOptions property

DLLName property

DocumentOptions property

EnableSaveResultsToMemory property

EnumOutputFileFormats event

ExtName property

FileFormatInfo property

Format property

FormatLevel property

FormatName property

GetFileFormatInfo method

GetRecognitionResultOptions method

GetOutputFileFormats method

MarkOptions property

MemoryRecognitionResult property

MemoryRecognitionResultSize property

ParagraphOptions property

RecognitionDataFileName property

ResultOptions property

SaveDocument method

SaveResultsToMemory method

SetRecognitionResultOptions method

Type property


Quick Reference OCR: Using the Document Options

Quick Reference OCR:
Using the Document Options

Color property

DocumentOptions property

EnablePageBreaks property

EnableTextInBoxes property

GetRecognitionResultOptions method

LanguageMode property

MarginHeight property

MarginLeft property

MarginsMode property

MarginTop property

MarginWidth property

PaperOrientation property

PaperSizeMode property

PaperType property

ResultOptions property

SetRecognitionResultOptions method

TableMethod property


Quick Reference OCR: Using the Paragraph Options

Quick Reference OCR:
Using the Paragraph Options

Alignment property

AlignmentMode property

FirstLineIndent property

GetRecognitionResultOptions method

LineSpacing property

LineSpacingMode property

ParagraphIndentMode property

ParagraphOptions property

ResultOptions property

SetRecognitionResultOptions method

SpaceBefore property

SpaceBeforeMode property


Quick Reference OCR: Using the Character Options

Quick Reference OCR:
Using the Character Options

Bold property

CharacterOptions property

FontNames property

GetRecognitionResultOptions method

Italic property

ResultOptions property

SelOutputFont property

SetRecognitionResultOptions method

Size property

Underline property


Quick Reference OCR: Using the Mark Options

Quick Reference OCR:
Using the Mark Options

ColMissingSymbol property

ColorSuspectCharacter property

ColRejectionSymbol property

ColSuspectWord property

GetRecognitionResultOptions method

MarkOptions property

ResultOptions property

SeparatorBeforeMissingSymbol property

SeparatorBeforeRejectionSymbol property

SeparatorBeforeSuspectCharacter property

SeparatorEndLine property

SeparatorEndPage property

SeparatorEndParagraph property

SeparatorEndSuspectWord property

SeparatorEndTableRow property

SeparatorEndZone property

SeparatorStartLine property

SeparatorStartPage property

SeparatorStartParagraph property

SeparatorStartSuspectWord property

SeparatorStartTableRow property

SeparatorStartZone property

SetRecognitionResultOptions method


OCR Data Types

OCR Interfaces

ILEADRasterDocument

ILTCharacterOptions

ILTDocumentOptions

ILTFileFormatInfo

ILTHandPrintOptions

ILTMarkOptions

ILTOMROptions

ILTParagraphOptions

ILTRecognizedCharacters

ILTRecognizeStatus

ILTResultOptions

ILTZoneData

Enumerations

ALIGNMENT_TYPE

CHARFILTER

CHARFLAGS

FILL_METHOD

FONT_DEFINE

FONTFLAGS

FORMAT_LEVEL

FORMAT_OUTPUT_TYPE

FORMATTYPE

HAND_STYLE

LANG_IDS

LINE_SPACING

MaxLengthSizes

MODE_SELECTOR

OCR_PROCESS_ID

OMR_FRAME

OMR_SENSE

OUTPUT_COLOR

OUTPUT_LANGUAGE

PAGE_PARSER

PAPER_ORIENTATION

PAPER_TYPE

PenStyleConstants

RECOG_MODULE_TRADEOFF

RECOGNIZE_MODULE

TABLE_METHOD

VERIFY_CODE

ZONEFLAGS

ZONE_TYPE


ALIGNMENT_TYPE

typedef enum
{
ALIGN_LEFT = 0,
ALIGN_RIGHT,
ALIGN_CENTERED,
ALIGN_JUSTIFIED
} ALIGNMENT_TYPE;

The ALIGNMENT_TYPE enumerated type represents the possible alignment options.

Value | Meaning
ALIGN_LEFT | Paragraphs will have left alignment.
ALIGN_RIGHT | Paragraphs will have right alignment.
ALIGN_CENTERED | Paragraphs will be centered.
ALIGN_JUSTIFIED | Paragraphs will be justified (Default).

Comments

This enumerated type is used by the following object:

ILTParagraphOptions


CHARFILTER

typedef enum
{
CHAR_FILTER_DEFAULT = 0,
CHAR_FILTER_DIGIT,
CHAR_FILTER_UPPERCASE,
CHAR_FILTER_LOWERCASE,
CHAR_FILTER_PUNCTUATION,
CHAR_FILTER_MISCELLANEOUS,
CHAR_FILTER_PLUS,
CHAR_FILTER_ALL,
CHAR_FILTER_ALPHA,
CHAR_FILTER_NUMBERS
} CHARFILTER;

The CHARFILTER enumerated type represents the possible character set filters for a zone.

Value | Meaning
CHAR_FILTER_DEFAULT | This value is used to have the zone handled globally. Do not combine this with any other filter.
CHAR_FILTER_DIGIT | Recognition of numerals only. E.g.: "3" (Digit Three).
CHAR_FILTER_UPPERCASE | Recognition of uppercase letters only, including accented ones. E.g.: "A" (Capital A).
CHAR_FILTER_LOWERCASE | Recognition of lowercase letters only including accented ones. E.g.: "a" (Lowercase a).
CHAR_FILTER_PUNCTUATION | Recognition of punctuation signs only. E.g.: "!" (Exclamation Mark).
CHAR_FILTER_MISCELLANEOUS | Recognition of miscellaneous characters only. E.g.: "+" (Plus sign).
CHAR_FILTER_PLUS | Enables the use of the Filter Plus characters specified by the LanguageCharacterPlusFilter property. The Filter Plus characters are added to the language environment after any filtering. This filter can also be used to achieve a very limited character set.
CHAR_FILTER_ALL | Since all elements are enabled, there is no filtering.
CHAR_FILTER_ALPHA | Recognition of upper and lowercase letters only.
CHAR_FILTER_NUMBERS | Recognition of the digits, plus the Filter Plus characters set by the LanguageCharacterPlus property.

Comments

This enumerated type is used by the following object:

ILTZoneData


CHARFLAGS

typedef enum
{
CHAR_ENDOFLINE = 0x001,
CHAR_ENDOFPARA = 0x002,
CHAR_ENDOFWORD = 0x004,
CHAR_ENDOFZONE = 0x008,
CHAR_ENDOFPAGE = 0x010,
CHAR_ENDOFCELL = 0x020,
} CHARFLAGS;

The CHARFLAGS enumerated type represents possible locations of a recognized character.

Value | Meaning
CHAR_ENDOFLINE | This is the last character in a line.
CHAR_ENDOFPARA | This is the last character in a paragraph.
CHAR_ENDOFWORD | This is the last character in a word.
CHAR_ENDOFZONE | This is the last character in a zone.
CHAR_ENDOFPAGE | This is the last character in a page.
CHAR_ENDOFCELL | This is the last character in a cell. (This is applicable only for ZONE_TYPE_TABLE zones.)

Comments

This enumerated type is used by the following object:

ILTRecognizedCharacters


FILL_METHOD

typedef enum
{
FM_DEFAULT = 0,
FM_OMNIFONT,
FM_DRAFTDOT9,
FM_OMR,
FM_HANDPRINT,
FM_DRAFTDOT24,
FM_OCRA,
FM_OCRB,
FM_MICR,
FM_DOTDIGIT,
FM_DASHDIGIT,
FM_ASIAN,
FM_NO_OCR,
} FILL_METHOD;

The FILL_METHOD enumerated type represents the possible filling methods for a zone.

Value | Meaning
FM_DEFAULT | This value denotes that the filling method for a zone is undetermined.
FM_OMNIFONT | The omnifont zone filling method. It denotes a machine printed text with any typeface which is not too stylized.
FM_DRAFTDOT9 | The 9-pin draft dot-matrix zone filling method. It denotes a 9-pin draft dot-matrix printout.
FM_OMR | The optical mark zone filling method. It specifies a search for the presence or absence of an OMR mark within the zone.
FM_HANDPRINT | The handprinted zone filling method. It denotes handprinting within the zone.
FM_DRAFTDOT24 | The 24-pin draft dot-matrix zone filling method. It denotes a 24-pin draft dot-matrix printout.
FM_OCRA | The OCR-A zone filling method.
FM_OCRB | The OCR-B zone filling method.
FM_MICR | The magnetic ink character filling method (also called E-13B).
FM_DOTDIGIT | The dot-digit zone filling method.
FM_DASHDIGIT | The dash-digit zone filling method.
FM_ASIAN | Zone filled by Asian text.
FM_NO_OCR | No recognition will be attempted.

Comments

This enumerated type is used by the following object:

ILTZoneData


FONT_DEFINE

typedef enum
{
FONTPROPORTSERIF = 1,
FONTPROPORTSANSSERIF,
FONTMONOSERIF,
FONTMONOSANSSERIF,
FONTPREDEFFONT,
} FONT_DEFINE;

The FONT_DEFINE enumerated type represents the possible fonts.

Value | Meaning
FONTPROPORTSERIF | Serif font - Times New Roman
FONTPROPORTSANSSERIF | Arial
FONTMONOSERIF | Serif font - Courier New
FONTMONOSANSSERIF | SansSerif font - Courier New
FONTPREDEFFONT | Pre-defined - Times New Roman

Comments

This enumerated type is used by the following object:

ILTCharacterOptions


FONTFLAGS

typedef enum
{
FONT_ITALIC = 0x001,
FONT_BOLD = 0x002,
FONT_UNDERLINE = 0x004,
FONT_SUBSCRIPT = 0x008,
FONT_SUPERSCRIPT = 0x010,
FONT_SANSSERIF = 0x020,
FONT_SERIF = 0x040,
FONT_PROPORTIONAL = 0x080,
} FONT_DEFINE;

The FONT_DEFINE enumerated type represents the possible fonts.

Value | Meaning
FONT_ITALIC | The character is italic.
FONT_BOLD | The character is bold.
FONT_UNDERLINE | The character is underlined.
FONT_SUBSCRIPT | The character is subscript.
FONT_SUPERSCRIPT | The character is superscript.
FONT_SANSSERIF | The character is Sans Serif.
FONT_SERIF | The character is Serif.
FONT_PROPORTIONAL | The character is proportional.

Comments

This enumerated type is used by the following object:

ILTRecognizedCharacters


FORMAT_LEVEL

typedef enum
{
FORMATLEVEL_FULL = 0,
FORMATLEVEL_PART,
FORMATLEVEL_DROP,
} FORMATLEVEL;

The FORMAT_LEVEL enumerated type represents how much formatting is exported.

Value | Meaning
FORMATLEVEL_FULL | All formatting is retained, including text zoning (Default).
 | It keeps the original layout of the pages, including columns. This is done with text, graphical and table zones and frames. This is offered only for target applications capable of handling these. FORMATLEVEL_FULL formatting is the only choice for all PDF export, except for the file type "Adobe PDF edited".
FORMATLEVEL_PART | A partial set of output formatting elements is retained.
 | All recognized paragraph and character formatting features along with graphics and tables are exported.
FORMATLEVEL_DROP | Only some character formatting properties (font size and name) is exported, if applicable. When exporting to text file types, graphics and tables are not supported.

Comments

This enumerated type is used by the following object:

ILTResultOptions


FORMAT_OUTPUT_TYPE

typedef enum
{
OUTTYPE_PLAIN,
OUTTYPE_WORD_PROCESSOR,
OUTTYPE_TRUE_WORD_PROCESSOR,
OUTTYPE_TABLE,
OUTTYPE_UNKNOWN,
} FORMAT_OUTPUT_TYPE;

The FORMAT_OUTPUT_TYPE enumerated type represents the possible text output types.

Value | Meaning
OUTTYPE_PLAIN | Plain text: only characters, without any formatting information, embedded images or framed text. Corresponds to FORMATLEVEL_DROP
OUTTYPE_WORD_PROCESSOR | Word processor output: formatted text. May handle embedded images, but not columns or text frames. Corresponds to FORMATLEVEL_DROP or FORMATLEVEL_PART
OUTTYPE_TRUE_WORD_PROCESSOR | Sophisticated word processor output: Supports formatted text with embedded images, and text or other elements in frames. Corresponds to any of the three format levels.
OUTTYPE_TABLE | Spreadsheet output.
OUTTYPE_UNKNOWN | Unknown output. The selected output converter is unknown for the Engine.

Comments

This enumerated type is used by the following object:

ILTFileFormatInfo


FORMATTYPE

typedef enum
{
DOCTEXT_STANDARD = 0,
DOCTEXT_SMART,
DOCTEXT_STRIPPED,
DOCTEXT_PLAIN,
DOCTEXT_COMMA_DELIMITED,
DOCTEXT_TAB_DELIMITED,
DOCREC_ASCII_FORMATTED,
DOCREC_ASCII_STANDARD,
DOCREC_ASCII_STANDARDEX,
DOCGENERAL_WORD_PROCESSOR,
DOCPDF,
DOCPDF_IMAGE_SUBSTITUTES,
DOCPDF_IMAGE_ON_TEXT,
DOCPDF_IMAGEONLY,
DOCPDF_EDITED,
DOCHTML_3_2,
DOCHTML_4_0,
DOCWORD_97_2000_XP,
DOCEXCEL_97_2000,
DOCWORDPERFECT_8,
DOCRTF,
DOCPPT_97_RTF,
DOCPUB_98_RTF,
DOCWORDPAD_RTF,
DOCRTF_WORD_2000,
DOCRTF_WORD_97,
DOCRTF_WORD_6_95,
DOCOPEN_EBOOK_1_0,
DOCXML,
DOC2G_TYPE_2,
DOC2G_TYPE_3,
} FORMATTYPE;

The FORMATTYPE enumerated type represents the possible document format types.

Value | Meaning
DOCTEXT_STANDARD | Text - Standard
DOCTEXT_SMART | Text - Smart
DOCTEXT_STRIPPED | Text - Stripped
DOCTEXT_PLAIN | Text - Plain
DOCTEXT_COMMA_DELIMITED | Text - Comma Delimited
DOCTEXT_TAB_DELIMITED | Text - Tab Delimited
DOCREC_ASCII_FORMATTED | Rec ASCII (Formatted)
DOCREC_ASCII_STANDARD | Rec ASCII (Standard)
DOCREC_ASCII_STANDARDEX | Rec ASCII (StandardEx)
DOCGENERAL_WORD_PROCESSOR | General Word Processor
DOCPDF_IMAGE_SUBSTITUTES | Adobe PDF with image substitutes
DOCPDF_IMAGE_ON_TEXT | Adobe PDF with image on text
DOCPDF_IMAGEONLY | Adobe PDF image only
DOCPDF_EDITED | Adobe PDF edited
DOCHTML_3_2 | HTML 3.2
DOCHTML_4_2 | HTML 4.0
DOCWORD_97_2000_XP | Word 97, 2000, XP
DOCEXCEL_97_2000 | Excel 97, 2000
DOCWORDPERFECT_8 | WordPerfect 8
DOCRTF | Rich Text Format
DOCPPT_97_RTF | PowerPoint 97 (RTF)
DOCPUB_98_RTF | Publisher 98 (RTF)
DOCWORDPAD_RTF | WordPad (RTF)
DOCRTF_WORD_2000 | RTF Word 2000
DOCRTF_WORD_97 | RTF Word 97
DOCRTF_WORD_6_95 | RTF Word 6.0/95
DOCXML | XML
DOC2G_TYPE_2 | 2G Type 2
DOC2G_TYPE_3 | 2G Type 3

Comments

This enumerated type is used by the following object:

ILTResultOptions


HAND_STYLE

typedef enum
{
HANDSTYLE_EURO,
HANDSTYLE_US
} HAND_STYLE;

The HAND_STYLE enumerated type represents the possible writing styles for hand printed numerals.

Value | Meaning
HANDSTYLE_EURO | Writing in European style (Default).
HANDSTYLE_US | Writing in North-American style.

Comments

This enumerated type is used by the following object:

ILTHandPrintOptions


LANG_IDS

typedef enum
{
LANGID_AUTO = -2,
LANGID_NO = -1,
LANGID_ENGLISH = 0,
LANGID_GERMAN,
LANGID_FRENCH,
LANGID_DUTCH,
LANGID_NORWEGIAN,
LANGID_SWEDISH,
LANGID_FINNISH,
LANGID_DANISH,
LANGID_ICELANDIC,
LANGID_PORTUGUESE,
LANGID_SPANISH,
LANGID_CATALAN,
LANGID_ITALIAN,
LANGID_MALTESE,
LANGID_GREEK,
LANGID_POLISH,
LANGID_CZECH,
LANGID_SLOVAK,
LANGID_HUNGARIAN,
LANGID_SLOVENIAN,
LANGID_CROATIAN,
LANGID_ROMANIAN,
LANGID_ALBANIAN,
LANGID_TURKISH,
LANGID_ESTONIAN,
LANGID_LATVIAN,
LANGID_LITHUANIAN,
LANGID_ESPERANTO,
LANGID_SERBIAN,
LANGID_MACEDONIAN,
LANGID_MOLDAVIAN,
LANGID_BULGARIAN,
LANGID_BYELORUSSIAN,
LANGID_UKRAINIAN,
LANGID_RUSSIAN,
LANGID_AFRIKAANS,
LANGID_AYMARA,
LANGID_BASQUE,
LANGID_BEMBA,
LANGID_BLACKFOOT,
LANGID_BRETON,
LANGID_BRAZILIAN,
LANGID_BUGOTU,
LANGID_CHAMORRO,
LANGID_CHECHEN,
LANGID_CHUANA_TSWANA,
LANGID_CORSICAN,
LANGID_CROW,
LANGID_ESKIMO,
LANGID_FAROESE,
LANGID_FIJIAN,
LANGID_FRISIAN,
LANGID_FRIULIAN,
LANGID_GAELIC_IRISH,
LANGID_GAELIC_SCOTTISH,
LANGID_GANDA_LUGANDA,
LANGID_GUARANI,
LANGID_HANI,
LANGID_HAWAIIAN,
LANGID_IDO,
LANGID_INDONESIAN,
LANGID_INTERLINGUA,
LANGID_KABARDIAN,
LANGID_KASUB,
LANGID_KAWA,
LANGID_KIKUYU,
LANGID_KONGO,
LANGID_KPELLE,
LANGID_KURDISH,
LANGID_LAPPISH,
LANGID_LATIN,
LANGID_LUBA,
LANGID_LUXEMBOURGIAN,
LANGID_MALAGASY,
LANGID_MALAY,
LANGID_MALINKE,
LANGID_MAORI,
LANGID_MAYAN,
LANGID_MIAO,
LANGID_MINANKABAW,
LANGID_MOHAWK,
LANGID_NAHUATL,
LANGID_NYANJA,
LANGID_OCCIDENTAL,
LANGID_OJIBWAY,
LANGID_PAPIAMENTO,
LANGID_PIDGIN_ENGLISH,
LANGID_PROVENCAL,
LANGID_QUECHUA,
LANGID_RHAETIC,
LANGID_ROMANY,
LANGID_RUANDA,
LANGID_RUNDI,
LANGID_SAMOAN,
LANGID_SARDINIAN,
LANGID_SHONA,
LANGID_SIOUX,
LANGID_SOMALI,
LANGID_SOTHO_SUTO_SESUTO,
LANGID_SUNDANESE,
LANGID_SWAHILI,
LANGID_SWAZI,
LANGID_TAGALOG,
LANGID_TAHITIAN,
LANGID_TINPO,
LANGID_TONGAN,
LANGID_TUN,
LANGID_VISAYAN,
LANGID_WELSH,
LANGID_WEND_SORBIAN,
LANGID_WOLOF,
LANGID_XHOSA,
LANGID_ZAPOTEC,
LANGID_ZULU,
LANGID_GALICIAN,
LANGID_SERBIAN_LATIN,
LANGID_SAMI,
LANGID_LULE_SAMI,
LANGID_NORTHERN_SAMI,
LANGID_SOUTHERN_SAMI,
} LANG_IDS;

The LANG_IDS enumerated type represents the languages supported by the OCR engine.

Value | Meaning
LANGID_AUTO | Used Auto language
LANGID_NO | No selected language
LANGID_ENGLISH | English
LANGID_GERMAN | German
LANGID_FRENCH | French
LANGID_DUTCH | Dutch
LANGID_NORWEGIAN | Norwegian
LANGID_SWEDISH | Swedish
LANGID_FINNISH | Finnish
LANGID_DANISH | Danish
LANGID_ICELANDIC | Icelandic
LANGID_PORTUGUESE | Portuguese
LANGID_SPANISH | Spanish
LANGID_CATALAN | Catalan
LANGID_ITALIAN | Italian
LANGID_MALTESE | Maltese
LANGID_GREEK | Greek
LANGID_POLISH | Polish
LANGID_CZECH | Czech
LANGID_SLOVAK | Slovak
LANGID_HUNGARIAN | Hungarian
LANGID_SLOVENIAN | Slovenian
LANGID_CROATIAN | Croatian
LANGID_ROMANIAN | Romanian
LANGID_ALBANIAN | Albanian
LANGID_TURKISH | Turkish
LANGID_ESTONIAN | Estonian
LANGID_LATVIAN | Latvian
LANGID_LITHUANIAN | Lithuanian
LANGID_ESPERANTO | Esperanto
LANGID_SERBIAN | Serbian
LANGID_MACEDONIAN | Macedonian
LANGID_MOLDAVIAN | Moldavian
LANGID_BULGARIAN | Bulgarian
LANGID_BYELORUSSIAN | Byelorussian
LANGID_UKRAINIAN | Ukrainian
LANGID_RUSSIAN | Russian
LANGID_AFRIKAANS | Afrikaans
LANGID_AYMARA | Aymara
LANGID_BASQUE | Moldavian
LANGID_BEMBA | Bemba
LANGID_BLACKFOOT | Blackfoot
LANGID_BRETON | Breton
LANGID_BRAZILIAN | Brazilian
LANGID_BUGOTU | Bugotu
LANGID_CHAMORRO | Chamorro
LANGID_CHECHEN | Chechen
LANGID_CHUANA_TSWANA | Chuana Tswana
LANGID_CORSICAN | Corsican
LANGID_CROW | Crow
LANGID_ESKIMO | Eskimo
LANGID_FAROESE | Faroese
LANGID_FIJIAN | Fijian
LANGID_FRISIAN | Frisian
LANGID_FRIULIAN | Friulian
LANGID_GAELIC_IRISH | Gaelic Irish
LANGID_GAELIC_SCOTTISH | Gaelic Scottish
LANGID_GANDA_LUGANDA | Ganda Luganda
LANGID_GUARANI | Guarani
LANGID_HANI | HANI
LANGID_HAWAIIAN | Hawaiian
LANGID_IDO | IDO
LANGID_INDONESIAN | Indonesian
LANGID_INTERLINGUA | Interlingua
LANGID_KABARDIAN | Kabardian
LANGID_KASUB | Kasub
LANGID_KAWA | Kawa
LANGID_KIKUYU | Kikuyu
LANGID_KONGO | Kongo
LANGID_KPELLE | Kpelle
LANGID_KURDISH | Kurdish
LANGID_LAPPISH | Lappish
LANGID_LATIN | Latin
LANGID_LUBA | LUBA
LANGID_LUXEMBOURGIAN | Luxembourgian
LANGID_MALAGASY | Malagasy
LANGID_MALAY | Malay
LANGID_MALINKE | Malinke
LANGID_MAORI | Malinke
LANGID_MAYAN | Mayan
LANGID_MIAO | Miao
LANGID_MINANKABAW | Minankabaw
LANGID_MOHAWK | Mohawk
LANGID_NAHUATL | Nahuatl
LANGID_NYANJA | Nyanja
LANGID_OCCIDENTAL | Occidental
LANGID_OJIBWAY | Ojibway
LANGID_PAPIAMENTO | Papiamento
LANGID_PIDGIN_ENGLISH | Pidgin English
LANGID_PROVENCAL | Provencal
LANGID_QUECHUA | Quechua
LANGID_RHAETIC | Rhaetic
LANGID_ROMANY | Romany
LANGID_RUANDA | Ruanda
LANGID_RUNDI | Rundi
LANGID_SAMOAN | Samoan
LANGID_SARDINIAN | Sardinian
LANGID_SHONA | Shona
LANGID_SIOUX | Sioux
LANGID_SOMALI | Somali
LANGID_SOTHO_SUTO_SESUTO | Sotho Suto Sesuto
LANGID_SUNDANESE | Sundanese
LANGID_SWAHILI | Swahili
LANGID_SWAZI | Swazi
LANGID_TAGALOG | Tagalog
LANGID_TAHITIAN | Tahitian
LANGID_TINPO | Tinpo
LANGID_TONGAN | Tongan
LANGID_TUN | Tun
LANGID_VISAYAN | Visayan
LANGID_WELSH | Welsh
LANGID_WEND_SORBIAN | Wend Sorbian
LANGID_WOLOF | Wolof
LANGID_XHOSA | Xhosa
LANGID_ZAPOTEC | Zapotec
LANGID_ZULU | Zulu
LANGID_GALICIAN | Galician
LANGID_SERBIAN_LATIN | Serbian (Latin)
LANGID_SAMI | Sami
LANGID_LULE_SAMI | Lule Sami
LANGID_NORTHERN_SAMI | Northern Sami
LANGID_SOUTHERN_SAMI | Southern Sami

Comments

This enumerated type is used by the following:

ActiveLanguage property

SelectedLanguages property

DefaultSpellLanguages property

SpellLanguageID property

ILTRecognizedCharacters


LINE_SPACING

typedef enum
{
LINE_SPACE_HALF,
LINE_SPACE_ONE,
LINE_SPACE_ONEANDHALF,
LINE_SPACE_DOUBLE,
} LINE_SPACING;

The LINE_SPACING enumerated type represents the line spacing options.

Value | Meaning
LINE_SPACE_HALF | Half line spacing.
LINT_SPACE_ONE | Single line spacing (Default).
LINE_SPACE_ONEANDHALF | One and a half line spacing.
LINE_SPACE_DOUBLE | Double line spacing.

Comments

This enumerated type is used by the following object:

ILTParagraphOptions


MaxLengthSizes

typedef enum
{
SECTION_NAME_LENGTH = 17,
UD_ITEM_LENGTH = 64,
} MaxLengthSizes;

The MaxLengthSizes enumerated type represents

Value | Meaning
SECTION_NAME_LENGTH | Specifies the max length for the section name
UD_ITEM_LENGTH | Specifies the max length for the dictionary item


MODE_SELECTOR

typedef enum
{
SELNONE,
SELAUTO,
SELPREDEFINED
} MODE_SELECTOR;

The MODE_SELECTOR enumerated type indicates whether a value is exported or not and whether an exported value is calculated or predefined.

Value | Meaning
SELNONE | When this value is set for a formatting property, this property WON'T BE exported to the final output document, i.e. even if the final output document supports the particular property, it won't be sent to the document.
SELAUTO | When this value is set for a formatting property, this property will be calculated automatically by the Engine and will be exported to the final output document. This usually mirrors the properties of the original document.
SELPREDEFINED | When this value is set for a formatting property, this property will take a programmed value and be exported to the final output document.

Comments

This enumerated type is used by the following objects:

ILTCharacterOptions

ILTDocumentOptions

ILTParagraphOptions


OCR_PROCESS_ID

typedef enum
{
OCR_PROC_LOADING_IMG = 0,
OCR_PROC_SAVING_IMG,
OCR_PROC_FIND_ZONES,
OCR_PROC_RECOGNIZE_MOR,
OCR_PROC_RECOGNITION,
OCR_PROC_SPELLING,
OCR_PROC_SAVE_RECOG_RESULT,
OCR_PROC_WRITE_OUTPUT_DOC,
OCR_PROC_WRITE_OUTPUT_IMG,
OCR_PROC_RECOGNITION3,
OCR_PROC_PROCESSING_IMG
} OCR_PROCESS_ID;

The OCRPROCID enumerated type represents the possible OCR processes.

Value | Meaning
OCR_PROC_LOADING_IMG | Identifies the Image loading process
OCR_PROC_SAVING_IMG | Identifies the image saving process
OCR_PROC_FIND_ZONES | Identifies the page-layout decomposition (auto-zoning) process
OCR_PROC_RECOGNIZE_MOR | Identifies the 1st pass of the Recognition process. This pass is applicable only for the RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT recognition module
OCR_PROC_RECOGNITION | Identifies the 2nd pass of the Recognition process
OCR_PROC_SPELLING | Identifies the Checking process
OCR_PROC_SAVE_RECOG_RESULT | Reading from the recognition data file
OCR_PROC_WRITE_OUTPUT_DOC | Identifies the process for writing the recognized text to the final output document (to file or memory)
OCR_PROC_WRITE_OUTPUT_IMG | Identifies the image conversion process activated by the OCR_PROC_WRITE_OUTPUT_DOC process for saving the image of a graphical image zone to the word processor output document
OCR_PROC_RECOGNITION3 | Identifies the 3rd pass of the Recognition process. This pass is applicable only for the RECOGNIZE_MODULE_OMNIFONT_PLUS3W recognition module.
OCR_PROC_PROCESSING_IMG | Identifies the image pre-processing process.

Comments

This enumerated type is used by the following event:

ProgressStatus


OMR_FRAME

typedef enum
{
OMRFRAME_AUTO,
OMRFRAME_NO,
OMRFRAME_YES,
} OMR_FRAME;

The OMR_FRAME enumerated type represents the presence or absence of a frame in a zone, or whether frames will be automatically detected.

Value | Meaning
OMRFRAME_AUTO | Automatic frame detection (Default).
OMRFRAME_NO | There is no frame within the zone.
OMRFRAME_YES | There is a frame within the zone.

Comments

This enumerated type is used by the following object:

ILTOMROptions


OMR_SENSE

typedef enum
{
OMRSENSE_NORMAL,
OMRSENSE_LOW,
OMRSENSE_LOWER,
OMRSENSE_LOWEST,
} OMR_SENSE;

The OMRSENSE enumerated type represents the mark sensitivity.

Value | Meaning
OMRSENSE_NORMAL | Highest mark sensitivity (Default).
OMRSENSE_LOW | Less mark sensitivity.
OMRSENSE_LOWER | Lower mark sensitivity.
OMRSENSE_LOWEST | Lowest mark sensitivity.

Comments

This enumerated type is used by the following object:

ILTOMROptions


OUTPUT_COLOR

typedef enum
{
COL_NONEGR,
COL_BW,
COL_GRAY,
COL_TRUECOLOR,
COL_ORIGINAL
} OUTPUT_COLOR;

The OUTPUT_COLOR enumerated type represents the options for outputting graphics.

Value | Meaning
COL_NONEGR | Suppress all graphics in the final output document.
COL_BW | Convert all graphics zones to B/W before inserting them into the final output document.
COL_GRAY | Convert all graphics zones to 8-bit grayscale before inserting them into the final output document.
COL_TRUECOLOR | Convert all graphics zones to 24-bit color before inserting them into the final output document.
COL_ORIGINAL | Transmit all graphics zones without conversion.

Comments

This enumerated type is used by the following object:

ILTDocumentOptions


OUTPUT_LANGUAGE

typedef enum
{
LANGOUT_NO_LANGUAGE,
LANGOUT_ALBANIAN,
LANGOUT_FRENCH,
LANGOUT_FRENCH_BELGIAN,
LANGOUT_NORWEGIAN_NYNORSK,
LANGOUT_POLISH,
LANGOUT_BAHASA,
LANGOUT_CATALAN,
LANGOUT_CROATO_SERBIAN_LATIN,
LANGOUT_CZECH,
LANGOUT_DANISH,
LANGOUT_DUTCH,
LANGOUT_DUTCH_BELGIAN,
LANGOUT_ENGLISH_AUSTRALIAN,
LANGOUT_ENGLISH_UK,
LANGOUT_ENGLISH_US,
LANGOUT_FINNISH,
LANGOUT_FRENCH_CANADIAN,
LANGOUT_FRENCH_SWISS,
LANGOUT_GERMAN,
LANGOUT_GERMAN_SWISS,
LANGOUT_GREEK,
LANGOUT_HUNGARIAN,
LANGOUT_ICELANDIC,
LANGOUT_ITALIAN,
LANGOUT_ITALIAN_SWISS,
LANGOUT_NORWEGIAN,
LANGOUT_PORTUGUESE_BRAZILIAN,
LANGOUT_PORTUGUESE,
LANGOUT_RHAETO_ROMANIC,
LANGOUT_ROMANIAN,
LANGOUT_SLOVAK,
LANGOUT_SPANISH_CASTILIAN,
LANGOUT_SPANISH_MEXICAN,
LANGOUT_SWEDISH,
LANGOUT_TURKISH,
LANGOUT_SERBO_CROATIAN_CYRILLIC,
LANGOUT_BULGARIAN,
LANGOUT_RUSSIAN,
} OUTPUT_LANGUAGE;

The OUTPUT_LANGUAGE enumerated type represents the possible output languages.

Value | Meaning
LANGOUT_NO_LANGUAGE | No Language
LANGOUT_ALBANIAN | Albanian
LANGOUT_FRENCH | French
LANGOUT_FRENCH_BELGIAN | French Belgian
LANGOUT_NORWEGIAN_NYNORSK | Norwegian Nynorsk
LANGOUT_POLISH | Polish
LANGOUT_BAHASA | Bahasa
LANGOUT_CATALAN | Catalan
LANGOUT_CROATO_SERBIAN_LATIN | Croato Serbian Latin
LANGOUT_CZECH | Czech
LANGOUT_DANISH | Danish
LANGOUT_DUTCH | Dutch
LANGOUT_DUTCH_BELGIAN | Dutch Belgian
LANGOUT_ENGLISH_AUSTRALIAN | English Australian
LANGOUT_ENGLISH_UK | English UK
LANGOUT_ENGLISH_US | English US
LANGOUT_FINNISH | Finnish
LANGOUT_FRENCH_CANADIAN | French Canadian
LANGOUT_FRENCH_SWISS | French Swiss
LANGOUT_GERMAN | German
LANGOUT_GERMAN_SWISS | German Swiss
LANGOUT_GREEK | Greek
LANGOUT_HUNGARIAN | Hungarian
LANGOUT_ICELANDIC | Icelandic
LANGOUT_ITALIAN | Italian
LANGOUT_ITALIAN_SWISS | Italian Swiss
LANGOUT_NORWEGIAN | Norwegian
LANGOUT_PORTUGUESE_BRAZILIAN | Portuguese Brazilian
LANGOUT_PORTUGUESE | Portuguese
LANGOUT_RHAETO_ROMANIC | Rhaeto Romanic
LANGOUT_ROMANIAN | Romanian
LANGOUT_SLOVAK | Slovak
LANGOUT_SPANISH_CASTILIAN | Spanish Castilian
LANGOUT_SPANISH_MEXICAN | Spanish Mexican
LANGOUT_SWEDISH | Swedish
LANGOUT_TURKISH | Turkish
LANGOUT_SERBO_CROATIAN_CYRILLIC | Serbo Croatian Cyrillic
LANGOUT_BULGARIAN | Bulgarian
LANGOUT_RUSSIAN | Russian

Comments

This enumerated type is used by the following object:

ILTDocumentOptions


PAGE_PARSER

typedef enum
{
PARSER_AUTO = 0,
PARSER_LEGACY,
PARSER_STANDARD,
PARSER_FAST
} PAGE_PARSER;

The PAGE_PARSER enumerated type represents the possible page parser algorithms.

Value | Meaning
PARSER_AUTO | Specifies that the Engine will determine at run-time which page parser algorithm will be applied. (Default.)
PARSER_LEGACY | Identifies the page-parsing algorithm used in the toolkit till version 10.0.
PARSER_STANDARD | Identifies the most accurate page parsing algorithm of the Engine.
PARSER_FAST | This algorithm can be treated as a simplified variant of PARSE_LEGACY: this algorithm doesn't try to find tables on the page. It is the fastest (but least accurate) parsing algorithm available. Use it only for simple page parsing tasks!

Comments

This enumerated type is used by the following property:

ZoneParser property


PAPER_ORIENTATION

typedef enum
{
PAPER_ORIENT_PORTRAIT = 0,
PAPER_ORIENT_LANDSCAPE,
} PAPER_ORIENTATION;

The PAPER_ORIENTATION enumerated type represents the orientation of the output document.

Value | Meaning
PAPER_ORIENT_PORTRAIT | The orientation of the final output document is Portrait (Default).
PAPER_ORIENT_LANDSCAPE | The orientation of the final output document is Landscape.

Comments

This enumerated type is used by the following object:

ILTDocumentOptions


PAPER_TYPE

typedef enum
{
PAPER_A4,
PAPER_A0,
PAPER_A1,
PAPER_A2,
PAPER_A3,
PAPER_A5,
PAPER_A6,
PAPER_A7,
PAPER_B0,
PAPER_B1,
PAPER_B2,
PAPER_B3,
PAPER_B4,
PAPER_B5,
PAPER_B6,
PAPER_B7,
PAPER_LETTER,
PAPER_LEGAL,
PAPER_EXECUTIVE,
PAPER_FROMIMAGEMAX,
} PAPER_TYPE;

The PAPER_TYPE enumerated type represents the paper type.

Value | Meaning
PAPER__A4 | A4 size (Default).
PAPER__A0 | A0 size.
PAPER__A1 | A1 size.
PAPER__A2 | A2 size.
PAPER__A3 | A3 size.
PAPER__A5 | A5 size.
PAPER__A6 | A6 size.
PAPER__A7 | A7 size.
PAPER__B0 | B0 size.
PAPER__B1 | B1 size.
PAPER__B2 | B2 size.
PAPER__B3 | B3 size.
PAPER__B4 | B4 size.
PAPER__B5 | B5 size.
PAPER__B6 | B6 size.
PAPER__B7 | B7 size.
PAPER__LETTER | Letter size.
PAPER__LEGAL | Legal size.
PAPER__EXECUTIVE | Executive size.
PAPER__FROMIMAGEMAX | The size is determined from the original image.

Comments

This enumerated type is used by the following object:

ILTDocumentOptions


PenStyleConstants

typedef enum
{
PENSTYLE_SOLID = 0,
PENSTYLE_DASH = 1,
PENSTYLE_DOT = 2,
PENSTYLE_DASH_DOT = 3,
PENSTYLE_DASH_DOT_DOT = 4,
PENSTYLE_TRANSPARENT = 5,
PENSTYLE_INSIDE_SOLID = 6,
PENSTYLE_LAST = 6
} PenStyleConstants;

The PenStyleConstants enumerated type represents

Value | Meaning
PENSTYLE_SOLID | Solid
PENSTYLE_DASH | Dash
PENSTYLE_DOT | Dot
PENSTYLE_DASH_DOT | Dash Dot
PENSTYLE_DASH_DOT_DOT | Dash Dot Dot
PENSTYLE_TRANSPARENT | Transparent
PENSTYLE_INSIDE_SOLID | Inside Solid
PENSTYLE_LAST | Last Id


RECOG_MODULE_TRADEOFF

typedef enum
{
RECOG_MODULE_ACCURATE,
RECOG_MODULE_BALANCED,
RECOG_MODULE_FAST,
} RECOG_MODULE_TRADEOFF;

The RECOG_MODULE_TRADEOFF enumerated type represents the options available for trading off accuracy and speed during recognition.

Value | Meaning
RECOG_MODULE_ACCURATE | Most accurate recognition (Default)
RECOG_MODULE_BALANCED | Mid-level accuracy/speed recognition
RECOG_MODULE_FAST | Fast recognition

Comments

This enumerated type is used by the following property:

RecognizeModuleTradeoff property


RECOGNIZE_MODULE

typedef enum
{
RECOGNIZE_MODULE_AUTO = 0,
RECOGNIZE_MODULE_MTEXT_OMNIFONT,
RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT,
RECOGNIZE_MODULE_DOT_MATRIX,
RECOGNIZE_MODULE_OMR,
RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL,
RECOGNIZE_MODULE_RER_PRINTED,
RECOGNIZE_MODULE_BRAILLE,
RECOGNIZE_MODULE_MATRIX,
RECOGNIZE_MODULE_OMNIFONT_PLUS2W,
RECOGNIZE_MODULE_OMNIFONT_FRX,
RECOGNIZE_MODULE_OMNIFONT_PLUS3W,
} RECOGNIZE_MODULE;

The RECOGNIZE_MODULE enumerated type represents the possible types of recognition module associated with a zone.

Value | Meaning
RECOGNIZE_MODULE_AUTO | Specifies that the engine will try to automatically select the most suitable recognition module for the zone. This is determined just before recognition, according to the zone's filling method and, if necessary, other settings, most typically the Character Set.
RECOGNIZE_MODULE_MTEXT_OMNIFONT | Specifies the M/TEXT omnifont recognition module.
RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT | Specifies the multi-lingual MOR omnifont recognition module.
RECOGNIZE_MODULE_DOT_MATRIX | Specifies the DOT 9-pin draft dot-matrix recognition module.
RECOGNIZE_MODULE_OMR | Specifies the OMR optical mark recognition module.
RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL | Specifies the HNR handprinted numeral recognition module.
RECOGNIZE_MODULE_RER_PRINTED | Specifies the third-party RER reRecognition Handprint recognition module.
RECOGNIZE_MODULE_MATRIX | Specifies the MAT matrix matching recognition module.
RECOGNIZE_MODULE_OMNIFONT_PLUS2W | Specifies the two-way voting POWR++ omnifont recognition module. Note that this was the most accurate omnifont recognition module of the previous Capture SDK version, called RM_PLUS.
RECOGNIZE_MODULE_OMNIFONT_FRX | Specifies the FireWorX omnifont recognition module.
RECOGNIZE_MODULE_OMNIFONT_PLUS3W | Specifies the three-way voting omnifont recognition module. This is the most accurate, OmniPage 12 compatible omnifont recognition module.
RECOGNIZE_MODULE_ASIAN | Specifies the Asian OCR recognition module.

Comments

This enumerated type is used by the following object:

ILTZoneData


TABLE_METHOD

typedef enum
{
TM_USETABS,
TM_USECELLS,
} TABLE_METHOD;

The FORMAT_LEVEL enumerated type represents how to export table zones.

Value | Meaning
TM_USETABS | Export the recognized table zones by exporting TAB positions and TAB characters into the final output document (Default for FORMATLEVEL_DROP and FORMATLEVEL_PART).
TM_USECELLS | Export the recognized table zones as table objects with a row-and-column cell structure into the final output document (Default for FORMATLEVEL_FULL).

Comments

This enumerated type is used by the following object:

ILTDocumentOptions


VERIFY_CODE

typedef enum
{
VF_IMPOSSIBLE = 0,
VF_UNLIKELY,
VF_UNRESOLVED,
VF_POSSIBLE,
VF_ACCEPT,
} VERIFY_CODE;

The VERIFY_CODE enumerated type represents the possible verification codes.

Value | Meaning
VF_IMPOSSIBLE | The OCR engine has determined that the recognized string for the given zone cannot be possible.
VF_UNLIKELY | The OCR engine has determined that the recognized string for the given zone is unlikely to be acceptable.
VF_UNRESOLVED | The application's checking function cannot make a decision on the acceptability of the string for the zone.
VF_POSSIBLE | The OCR engine has determined that the recognized string for the given zone is possibly acceptable.
VF_ACCEPT | The OCR engine has determined that the recognized string for the given zone is certainly acceptable.

Comments

This enumerated type is used by the following event:

Verification


ZONE_TYPE

typedef enum
{
// Basic Zone type
ZONE_TYPE_FLOWTEXT = 0,
ZONE_TYPE_TABLE,
ZONE_TYPE_GRAPHIC,
// Further types created by the page-layout decomposition process:
ZONE_TYPE_COLUMN,
ZONE_TYPE_HEADER,
ZONE_TYPE_FOOTER,
ZONE_TYPE_CAPTION,
ZONE_TYPE_TITLE,
ZONE_TYPE_OTHER,
ZONE_TYPE_SGRAPHIC,
} ZONE_TYPE;

The ZONE_TYPE enumerated type represents the possible zone types.

Value | Meaning
ZONE_TYPE_FLOWTEXT | flow text type zone.
ZONE_TYPE_TABLE | table type zone
ZONE_TYPE_GRAPHIC | zone containing graphics
ZONE_TYPE_COLUMN | column type zone
ZONE_TYPE_HEADER | header type zone
ZONE_TYPE_FOOTER | footer type zone.
ZONE_TYPE_CAPTION | caption type zone
ZONE_TYPE_TITLE | title type zone
ZONE_TYPE_OTHER | other zone type.
ZONE_TYPE_SGRAPHIC | zone containing graphics (sure).
ZONE_TYPE_HORZTEXT | horizontal text. Used in Asian OCR only
ZONE_TYPE_VERTTEXT | vertical text. Used in Asian OCR only

Comments

This enumerated type is used by the following object:

ILTZoneData


ZONEFLAGS

typedef enum
{
/* input flags:*/
ZONE_CHK_LANGDICT_PROHIBIT = 0x00000001,
ZONE_CHK_USERDICT_PROHIBIT = 0x00000002,
ZONE_CHK_CHECKCBF_PROHIBIT = 0x00000004,
ZONE_CHK_VERTDICT_PROHIBIT = 0x00000008,
ZONE_CHK_IGNORE_WHITESPACE = 0x00000010,
ZONE_CHK_IGNORE_CASE = 0x00000020,
ZONE_CHK_PASS_LINES = 0x00000040,
ZONE_CHK_CORRECTION_DISABLED = 0x00000080,
ZONE_CHK_INCLUDE_PUNCTUATION = 0x00000100,
ZONE_CHK_CORRECT_PROPERNAMES = 0x00000200,
/* output flags:*/
ZONE_CHK_LANGDICT_USED = 0x00010000,
ZONE_CHK_USERDICT_USED = 0x00020000,
ZONE_CHK_CHECKCBF_USED = 0x00040000,
} ZONEFLAGS;

The ZONEFLAGS enumerated type represents

Value | Meaning
ZONE_CHK_LANGDICT_PROHIBIT | [0x00000001] Prohibit the use of the Language dictionary.
ZONE_CHK_USERDICT_PROHIBIT | [0x00000002] Prohibit the use of the User dictionary.
ZONE_CHK_CHECKCBF_PROHIBIT | [0x00000004] Prohibit the use of the user-written checking callback function.
ZONE_CHK_VERTDICT_PROHIBIT | [0x00000008] Prohibit the use of the Vertical dictionary
ZONE_CHK_IGNORE_WHITESPACE | [0x00000010] Ignore white space characters (SPACE and TAB characters) during checking. This field should be used together with the ZONE_CHK_PASS_LINES.
ZONE_CHK_IGNORE_CASE | [0x00000020] Case insensitive UD-checking
ZONE_CHK_PASS_LINES | [0x00000040] Instructs the RECOGMODULE to pass entire lines to the checker, instead of words. Do not use this attribute in conjunction with spell checking.
ZONE_CHK_CORRECTION_DISABLED | [0x00000080] Correction done by the Spell module is disabled even if it is enabled at page-level
ZONE_CHK_INCLUDE_PUNCTUATION | [0x00000100] Checking will consider punctuation characters on the boundaries of the strings, as well
ZONE_CHK_CORRECT_PROPERNAMES | [0x00000200] Enables the correction of words beginning with an uppercase letter inside a sentence (i.e. typically but not always proper names)
ZONE_CHK_LANGDICT_USED | [0x00010000] "After recognition flag": the Language dictionary was enabled during the checking process (spell checking was activated for the zone)
ZONE_CHK_USERDICT_USED | [0x00020000] "After recognition flag": the User dictionary was enabled during the checking process (UD-checking was activated for the zone).
ZONE_CHK_CHECKCBF_USED | [0x00040000] "After recognition flag": a user-written checking callback function was enabled during the checking process (user-written checking was activated)


ILEADRasterDocument

ActiveLanguage property

ActiveLanguagesCount property

ActivePageIndex property

AddItemToUserDictionary method

AddPage method

AddZone method

AutoOrientPage method

DefaultPageFillMethod property

DefaultSpellLanguages property

DefaultSpellLanguagesCount property

DestinationClipHeight property

DestinationClipLeft property

DestinationClipTop property

DestinationClipWidth property

DestinationHeight property

DestinationLeft property

DestinationTop property

DestinationWidth property

DictionaryDefaultSection property

DictionaryFileName property

DictionaryItemAttribute property

DictionaryState property

DrawPage method

DrawPersistence property

EnableCorrection property

EnableFireRecognizeStatus property

EnableMethodErrors property

EnableProgressStatusEvent property

EnableSaveResultsToMemory property

EnableShowZones property

EnableStopRecognizeStatus property

EnableSubSystem property

EnableZoneForceSingleColumn property

EnumOutputFileFormats event

ExportPage method

ExportZones method

FileFormatInfo property

FindZones method

GetAutoZoneOptions method

GetFileFormatInfo method

GetHandPrintOptions method

GetOMROptions method

GetOutputFileFormats method

GetRecognitionResultOptions method

GetRecognizedCharacters method

GetStatus method

GetStatus method

GetUserDictionarySection method

GetUserDictionarySectionItem method

GetZoneInfo method

HandPrintModuleOptions property

ImportZones method

IsCharacterEnabled method

LanguageCharacterFilter property

LanguageCharacterPlus property

LanguageCharacterPlusFilter property

LoadSettingsFile method

MemoryRecognitionResult property

MemoryRecognitionResultSize property

MOREnableFax property

OffsetZones method

OMRModuleOptions property

PageBitsPerPixel property

PageCount property

PageFillMethod property

PageHeight property

PageWidth property

ProgressStatus event

RecognitionDataFileName property

RecognitionStatus event

Recognize method

RecognizedCharacter property

RecognizedCharactersCount property

RecognizeModuleTradeoff property

RemoveItemFromUserDictionary method

RemovePage method

RemoveSelectedZone method

RemoveZone method

ResultOptions property

SaveDocument method

SaveResultsToMemory method

SaveSettingsFile method

ScaleMode property

SelectedLanguages property

SelectedLanguagesCount property

SelectedZone property

SelectedZonePenColor property

SelectedZonePenStyle property

SelectedZonePenWidth property

SelectLanguages method

SelectZone method

SelectZoneByPoint method

SelectZoneIndex property

SetAutoZoneOptions method

SetHandPrintOptions method

SetOMROptions method

SetRecognitionResultOptions method

SetRecognizedCharacters method

SetSelectedZonePen method

SetUserDictionary method

SetZonePen method

ShowZoneGridLines property

ShutDown method

SourceClipHeight property

SourceClipLeft property

SourceClipTop property

SourceClipWidth property

SourceHeight property

SourceLeft property

SourceTop property

SourceWidth property

SpecialMissingSymbol property

SpecialRejectedCharacter property

SpellLanguageID property

StartUp method

StopProgressStatusEvent property

UpdatePage method

UpdateZone method

UpdateZoneArea method

ZoneCount property

ZoneHeight property

ZoneLeft property

ZoneParser property

ZonePenColor property

ZonePenStyle property

ZonePenWidth property

ZoneTop property

ZoneWidth property


ILTCharacterOptions

Bold property

FontNames property

Italic property

SelOutputFont property

Size property

Underline property


ILTDocumentOptions

Color property

EnablePageBreaks property

EnableTextInBoxes property

LanguageMode property

MarginHeight property

MarginLeft property

MarginsMode property

MarginTop property

MarginWidth property

PaperOrientation property

PaperSizeMode property

PaperType property

ResultLanguage property

TableMethod property


ILTFileFormatInfo

DLLName property

ExtName property

FormatName property

Type property


ILTHandPrintOptions

CharacterHeight property

CharacterSpace property

CharacterWidth property

EnableSpace property

Style property


ILTMarkOptions

ColorSuspectCharacter property

ColMissingSymbol property

ColRejectionSymbol property

ColSuspectWord property

SeparatorBeforeMissingSymbol property

SeparatorBeforeRejectionSymbol property

SeparatorBeforeSuspectCharacter property

SeparatorEndLine property

SeparatorEndPage property

SeparatorEndParagraph property

SeparatorEndSuspectWord property

SeparatorEndTableRow property

SeparatorEndZone property

SeparatorStartLine property

SeparatorStartPage property

SeparatorStartParagraph property

SeparatorStartSuspectWord property

SeparatorStartTableRow property

SeparatorStartZone property


ILTOMROptions

EnableFill property

Frame property

Sense property


ILTParagraphOptions

Alignment property

AlignmentMode property

FirstLineIndent property

LineSpacing property

LineSpacingMode property

ParagraphIndentMode property

SpaceBefore property

SpaceBeforeMode property


ILTRecognizedCharacters

CellIndex property

Confidence property

Flags property

Font property

FontSize property

GuessCode property

GuessCode2 property

GuessCode3 property

Height property

LanguageId property

LanguageId2 property

Left property

Space property

SpaceErr property

Top property

Width property

YOffset property

ZoneIndex property


ILTRecognizeStatus

DecompositionTime property

PreProcessTime property

ReadingTime property

RecognizedCharacterCount property

RecognizedTime property

RecognizedWordCount property

RejectCharacterCount property

RejectWordCount property


ILTResultOptions

CharacterOptions property

DocumentOptions property

Format property

FormatLevel property

MarkOptions property

ParagraphOptions property


ILTZoneData

Bottom property

CharacterFilter property

EnableVerificationEvent property

FillMethod property

Flags property

ID property

Left property

RecognizeModule property

Right property

Top property

Type property

SectionName property

StopVerificationEvent property

Verification event

VerifyCode property


Error Codes

For a list of all possible return codes, refer to LEADTOOLS COM Return Codes in the Main COM help file (ltcomn.chm).

The following are the errors that are specifically related to the LEADTOOLS OCR document engine.

Error | No. | Description
ERROR_DOC_DLL_NOT_LOADED | 21200 | ScanSoft DLLs are not loaded
ERROR_DOC_INV_PAGE_INDEX | 21201 | Specified index is not correct
ERROR_DOC_INV_FILLMETHOD | 21202 | Invalid fill method
ERROR_DOC_INV_RECOG_MODULE | 21203 | Invalid recognition module
ERROR_DOC_INV_CHAR_FILTER | 21204 | Invalid character filter
ERROR_DOC_INV_ZONE_TYPE | 21205 | Invalid zone type
ERROR_DOC_INV_LANGID | 21206 | Invalid language Id
ERROR_DOC_INV_SPELL_LANGUAGE | 21207 | Invalid spell language
ERROR_DOC_INV_SECTION_ENUMERATION | 21208 | Invalid enumeration section
ERROR_DOC_INV_PAGE_COUNT | 21209 | Invalid page count
ERROR_DOC_ILLEGAL_CODE | 21210 | Illegal internal code as a parameter
ERROR_DOC_INV_PARAMETER | 21211 | Set parameter is not acceptable
ERROR_DOC_END_LIST_CODE_PAGES | 21212 | End of list of the available Code Pages
ERROR_DOC_LOAD_CODE_PAGE_FILE | 21213 | Error while loading the Code Page Definition file
ERROR_DOC_INV_BUFFER_SIZE | 21214 | The length of the exported code exceeds the buffer size
ERROR_DOC_INV_CHARACTER_CONVERSION | 21215 | Character conversion is not available for the given character
ERROR_DOC_INV_CHARACTER_LANGUAGE | 21216 | Conflict: The selected Code Page does not support some characters in the selected languages. There is no exact code in the Code Page for them
ERROR_DOC_INITIALIZE_CODE_PAGE | 21217 | Character Set and Code Pages module initialization error
ERROR_DOC_INITIALIZE_ENGINE | 21218 | OCR engine initialization error, or there is no appropriate license
ERROR_DOC_TERMINATE_ENGINE | 21219 | OCR engine termination error
ERROR_DOC_INITIALIZE_WARNING | 21220 | Module initialization warning
ERROR_DOC_PROCESS_USER_ABORT | 21221 | Application has aborted the current process
ERROR_DOC_FINISH_PROCESS | 21222 | Application has terminated the current recognition process without losing the recognized text
ERROR_DOC_MODULE_MISSING | 21223 | Module is not present
ERROR_DOC_MODULE_LOAD | 21224 | OS could not load a module
ERROR_DOC_MODULE_MISSING_ENTRY | 21225 | Missing entry in a module
ERROR_DOC_MODULE_INVALID | 21226 | Invalid module
ERROR_DOC_MODULE_INITIALIZE | 21227 | Module initialization error
ERROR_DOC_FEATURE_NOT_SUPPORTED | 21228 | The requested function is not available, or there is no appropriate license
ERROR_DOC_GENERAL | 21229 | General error in the engine
ERROR_DOC_GPF | 21230 | General Protection Fault in the engine
ERROR_DOC_NOT_SUPPORT_OS | 21231 | Unsupported operating system
ERROR_DOC_INV_SETTING_FILE | 21232 | Syntax error in the specified engine Settings file
ERROR_DOC_INV_SETTING | 21233 | Invalid setting
ERROR_DOC_ENGINE_BUSY | 21234 | The engine is busy
ERROR_DOC_RECOGNITION_TIME_OUT | 21235 | Recognition process Time Out
ERROR_DOC_INV_IMAGE_MODULE_SETTING | 21236 | Internal error in image module
ERROR_DOC_NO_MEMORY | 21237 | Not enough memory during image processing
ERROR_DOC_INV_IMAGE_DIMENSIONS | 21238 | Invalid rectangle dimensions
ERROR_DOC_INV_IMAGE_RESOLUTION | 21239 | Non-supported resolution
ERROR_DOC_CANNOT_COMPRESS_IMAGE | 21240 | Cannot process compressed image
ERROR_DOC_BAD_BITMAP | 21241 | Invalid bitmap address
ERROR_DOC_NOT_SUPPORT_BPP | 21242 | Unsupported BitsPerPixel value
ERROR_DOC_INV_IMAGE_MODULE | 21243 | Internal error in image module
ERROR_DOC_INV_IMAGE_HANDLE | 21244 | Invalid image handle
ERROR_DOC_BUFFER_OVERFLOW | 21245 | Buffer overflow during processing of the image
ERROR_DOC_ACCESS_DENIED | 21246 | Image operation denied
ERROR_DOC_NO_MORE_LINES | 21247 | No more lines in defined image area
ERROR_DOC_BAD_IMAGE_SIZE | 21248 | Non-supported image size
ERROR_DOC_BAD_ENGINE_MANAGER_MODULE | 21249 | Engine manager module error
ERROR_DOC_NO_RECOGNIZED_TEXT_AVAILABLE | 21250 | No recognized text available, either because the zone is empty or the required recognition module has not been initialized properly
ERROR_DOC_NO_SELECTED_RECOGNITION_MODULE | 21251 | There is no selected recognition module
ERROR_DOC_NO_ZONE | 21252 | There is no zone in the zone list
ERROR_DOC_INV_ZONE_INDEX | 21253 | Invalid zone index
ERROR_DOC_INV_ZONE_COORDINATES | 21254 | Invalid zone coordinates
ERROR_DOC_MOR_INITIALIZE_MODULE | 21255 | MOR recognition module initialization error
ERROR_DOC_MOR_BASE_FILE_NOT_FOUND | 21256 | MOR recognition module's knowledge base file not found
ERROR_DOC_MOR_BASE_FILE_CORRUPTED | 21257 | MOR recognition module's knowledge base file corrupted
ERROR_DOC_MOR_BASE_FILE_VERSION | 21258 | Incorrect knowledge base file version
ERROR_DOC_MOR_IMAGE_SIZE | 21259 | Size of image is too large
ERROR_DOC_MOR_FILE_CORRUPTED | 21260 | File is corrupted
ERROR_DOC_MOR_BAD_RECOG_MODULE | 21261 | Internal error in the MOR recognition module
ERROR_DOC_MOR_GPF_MODULE | 21262 | General Protection Fault in the MOR recognition module
ERROR_DOC_DOT_RECOGNITION | 21263 | Dot-matrix recognition error
ERROR_DOC_OMR_CHECKMARK_RECOGNITION | 21264 | Checkmark recognition error
ERROR_DOC_HNR_BASE_FILE__CORRUPTED | 21265 | HNR module's knowledge base file is corrupted
ERROR_DOC_HNR_PARAM_OUT_RANGE | 21266 | Parameter is out of valid range
ERROR_DOC_PER_MODULE | 21267 | Internal error in the RER module
ERROR_DOC_PER_BASE_FILE_NOT_FOUND | 21268 | RER module's knowledge base file not found
ERROR_DOC_PER_CHAR_SET_EMPTY | 21269 | Character Set is empty for the RER module
ERROR_DOC_PER_CHAR_SET_NOT_SUPPORTED | 21270 | The specified Character Set not fully supported by the RER recognition module
ERROR_DOC_PER_MODULE_NOT_FOUND | 21271 | RER specific file not found
ERROR_DOC_SPELL_NO_MEMORY | 21272 | Not enough memory for the SPL module
ERROR_DOC_SPELL_UNINITIALIZED | 21273 | Uninitialized spell object
ERROR_DOC_SPELL_FILE_OPEN | 21274 | Spell file open error
ERROR_DOC_SPELL_FILE_READ | 21275 | Spell file read error
ERROR_DOC_SPELL_USER_DICTIONARY_WRITE | 21276 | User dictionary write error
ERROR_DOC_SPELL_INV_FILE_FORMAT | 21277 | Invalid file format
ERROR_DOC_SPELL_INITIALIZE_MODULE | 21278 | Module initialization error
ERROR_DOC_SPELL_USER_DICTIONARY_CLOSE | 21279 | User dictionary close error
ERROR_DOC_SPELL_ILLEGAL_LANGUAGE_SETTING | 21280 | Illegal language setting
ERROR_DOC_SPELL_NO_MORE_ITEMS | 21281 | No more suggestions/items available
ERROR_DOC_SPELL_CHECK_ERROR | 21282 | Internal checking error
ERROR_DOC_SPELL_ITEM_ALREADY_EXIST | 21283 | Item already exists in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_EXIST | 21284 | Item doesn't exist in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_INSERTED | 21285 | Item wasn't inserted into the User dictionary
ERROR_DOC_SPELL_SECTION_NOT_EXIST | 21286 | Section does not exist in the User dictionary
ERROR_DOC_SPELL_BAD_SYNTEX | 21287 | Regular expression syntax error
ERROR_DOC_OUTPUT_NOT_INITIALIZED | 21288 | Output format conversion subsystem was not initialized
ERROR_DOC_OUTPUT_CONVERT_NOT_EXIST | 21289 | No more converters available
ERROR_DOC_OUTPUT_CONVERT_DLL_NOT_EXIST | 21290 | There is no converter DLL file
ERROR_DOC_OUTPUT_BAD_PARAMETER | 21291 | Wrong parameter or parameter not found
ERROR_DOC_OUTPUT_FILE_CORRUPTED | 21292 | TMP file is corrupted
ERROR_DOC_OUTPUT_FILE_NOT_FOUND | 21293 | TMP file not found
ERROR_DOC_OUTPUT_CREATE_FILE | 21294 | Cannot create TMP file
ERROR_DOC_OUTPUT_SEEK_FILE | 21295 | Cannot seek in TMP file
ERROR_DOC_OUTPUT_READ_FILE | 21296 | TMP file read error
ERROR_DOC_OUTPUT_WRITE_FILE | 21297 | TMP file write error
ERROR_DOC_OUTPUT_CLOSE_FILE | 21298 | Cannot close TMP file
ERROR_DOC_OUTPUT_LOAD_DLL | 21299 | Cannot load the DLL file
ERROR_DOC_OUTPUT_END_OF_FILE | 21300 | Internal error in ATMTXT module. (End-Of-File detected)
ERROR_DOC_OUTPUT_NO_MEMORY | 21301 | Not enough memory for ATMTXT/TMP module
ERROR_DOC_OUTPUT_IMAGE_NOT_AVAILABLE | 21302 | Image is not available for inserting into the output
ERROR_DOC_OUTPUT_NOT_REGISTER_INFO_ITEM | 21303 | Not enough memory to register an info item
ERROR_DOC_TXT_FILE_OPEN | 21304 | Output file open error
ERROR_DOC_TXT_FILE_READ | 21305 | Output file read error
ERROR_DOC_TXT_FILE_NOT_FOUND | 21306 | Output file not found
ERROR_DOC_TXT_FILE_WRITE | 21307 | Output file write error
ERROR_DOC_TXT_INV_COMMAND_SEQUENCE | 21308 | Invalid command sequence in the ICF file
ERROR_DOC_TXT_CREATE_FILE | 21309 | Cannot create the output file
ERROR_DOC_TXT_NO_MEMORY | 21310 | Not enough memory for ATMTXT/TXT module
ERROR_DOC_TXT_INV_DOCUMENT | 21311 | Invalid document type
ERROR_DOC_TXT_FILE_TOO_LARGE | 21312 | File too large
ERROR_DOC_TXT_WARNING_OUTPUT_FILE | 21313 | There was a WARNING during the output file conversion
ERROR_DOC_TXT_OPERATION_CANCELLED | 21314 | Operation cancelled
ERROR_DOC_TXT_ILLEGAL_OPTION | 21315 | Illegal option specified
ERROR_DOC_TXT_ENCRYPTED_SOURCE | 21316 | Encrypted source
ERROR_DOC_TXT_SEEK_ERROR | 21317 | Output file seek error
ERROR_DOC_BRAILLE_BAD_INITIALIZATION | 21318 | Braille recognition module initialization error
ERROR_DOC_MATRIX_BAD_INITIALIZATION | 21319 | Matrix matching recognition module initialization error
ERROR_DOC_MTX_BAD_INITIALIZATION | 21320 | M/TEXT recognition module initialization error
ERROR_DOC_NON_IMPLEMENTED_FEATURE | 21321 | Non-implemented feature
ERROR_DOC_NOT_FOUND_ZONE | 21322 | Couldn’t find specific zone
ERROR_DOC_NO_SELECTED_ZONE | 21323 | No available selected zone
ERROR_DOC_EXPORT_PAGE | 21324 | Can’t export the specified page
ERROR_DOC_LOCK_PAGE | 21325 | Can’t lock the specified page
ERROR_DOC_ACTIVE_PAGE | 21326 | Can’t set the specified page to be activated.
ERROR_DOC_LOCKED | 21327 | The OCR document engine is locked.
ERROR_DOC_OUTPUT_PDF_LOCKED | 21328 | Output PDF engine is locked.
ERROR_DOC_OMR_LOCKED | 21329 | OMR Options is locked
ERROR_DOC_ICR_LOCKED | 21330 | ICR Options is locked


ActiveLanguage property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS ActiveLanguage (short iIndex);
Overview | Refer to Working with Languages

Remarks

Gets or sets an array of language IDs that represent the languages activated by the SelectLanguages method. These are the "active languages" for the OCR engine. For a list of possible values, refer to LANG_IDS.

The SelectLanguages method will update the SelectedLanguages property with the languages that were activated.

The ActiveLanguagesCount property must be set before setting this property, to determine the number of active languages in this array.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


ActiveLanguagesCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ActiveLanguagesCount
Overview | Refer to Working with Languages

Remarks

Gets or sets the number of active languages in the OCR engine.

The ActiveLanguagesCount property must be set before setting the ActiveLanguage property, to determine the number of active languages in the ActiveLanguages property.

See Also

Elements: | ActiveLanguage property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


ActivePageIndex property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ActivePageIndex
Overview | Refer to Drawing Pages and Zones

Remarks

Specifies the index of the page to be drawn. This index is zero-based.

This property must be set before calling the DrawPage method. The value of this property must be the same as the page index value passed to the DrawPage method, for the correct page to be drawn.

See Also

Elements: | DrawPage method, DrawPersistence property, EnableShowZones property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


DefaultPageFillMethod property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | FILL_METHOD DefaultPageFillMethod (short iPageIndex);
Overview | Refer to Working with Zones

Remarks

(Read only) Gets the default fill method used for filling zones on the specified page. For a list of possible values, refer to FILL_METHOD.

See Also

Elements: | DefaultPageFillMethod property, ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, GetZoneInfo method, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


DefaultSpellLanguages property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS DefaultSpellLanguages (short iIndex);
Overview | Refer to Working with Languages

Remarks

Gets list of default languages used to check spelling. For a list of possible values, refer to LANG_IDS.

The content of the resulting list depends on the configuration of the OCR document engine, that is the presence of the Language dictionary files in the engine Binary directory. For the list of the supported languages, refer to Language Dictionary List.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguagesCount property, ActiveLanguage property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


DefaultSpellLanguagesCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DefaultSpellLanguagesCount
Overview | Refer to Working with Languages

Remarks

(Read only) Gets the number of default languages used to check spelling.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, ActiveLanguage property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


DestinationClipHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationClipHeight
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the height of the clipping rectangle that determines the portion of the destination display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationClipLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationClipLeft
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the left boundary of the clipping rectangle that determines the portion of the destination display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationClipTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationClipTop
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the top boundary of the clipping rectangle that determines the portion of the destination display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationClipWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationClipWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the width of the clipping rectangle that determines the portion of the destination display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationLeft
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the left boundary of the destination page on which the DrawPage method will draw.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationHeight
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the height of the destination page on which the DrawPage method will draw.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationTop
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the top boundary of the destination page on which the DrawPage method will draw.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DestinationWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float DestinationWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets width of the destination page on which the DrawPage method will draw.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


DetectOrientationDegree property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long DetectOrientationDegree(short iPageIndex)
Overview | Refer to Working with Pages

Remarks

(Read only) This property is updated with the angle by which the specified page needs to be oriented. If the specified page does not need to be oriented this property is updated with 0.

Possible values for this property are: 0, 90, 180 and 270 degrees.

The purpose of orientation is to make the page more readable during recognition by making sure the top of the page is positioned properly. That is, a page that is oriented correctly like this:

is much more readable than the same page oriented like this:

To orient the page automatically, call the AutoOrientPage method.

See Also

Elements: | AddPage method, PageCount property, RemovePage method, ExportPage method, UpdatePage method, AutoOrientPage method
Topics: | Quick Reference OCR: Working with Pages


DictionaryDefaultSection property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR DictionaryDefaultSection
Overview | Refer to Working with a Dictionary

Remarks

Gets or sets the name of the user dictionary and the default section of the user dictionary used in the recognition process.

This property is updated with the name of a user dictionary's default section when a user dictionary is opened using the SetUserDictionary method.

A user dictionary's default section is always the first section in the dictionary.

See Also

Elements: | DictionaryFileName property, GetUserDictionarySectionItem method, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, RemoveItemFromUserDictionary method, DictionaryState property, DictionaryItemAttribute property
Topics: | Quick Reference OCR: Working with a Dictionary


DictionaryFileName property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR DictionaryFileName
Overview | Refer to Working with a Dictionary

Remarks

Gets or sets the user dictionary file name.

This file name may represent the file in which to save a newly created user dictionary, or it may represent the name of a file from which to load an existing user dictionary. For more information refer to the SetUserDictionary method or the Working with a Dictionary topic.

See Also

Elements: | DictionaryFileName property, GetUserDictionarySectionItem method, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, RemoveItemFromUserDictionary method, DictionaryState property, DictionaryDefaultSection property, DictionaryItemAttribute property
Topics: | Quick Reference OCR: Working with a Dictionary


DictionaryItemAttribute property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long DictionaryItemAttribute
Overview | Refer to Working with a Dictionary

Remarks

Gets or sets a value that indicates whether the dictionary item is a literal or a regular expression. Possible values are:

Value | Meaning
USER_DICT_LITERAL | The dictionary item is a literal.
USER_DICT_REGULAR_EXPRESSION | The dictionary item is a regular expression.

This property must be set before calling the SetUserDictionary method or before calling the RemoveItemFromUserDictionary method.

To actually add an item to the user dictionary, use the AddItemToUserDictionary method.

To remove an item from the user dictionary, use the RemoveItemFromUserDictionary method.

See Also

Elements: | DictionaryFileName property, GetUserDictionarySectionItem method, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, RemoveItemFromUserDictionary method, DictionaryState property, DictionaryDefaultSection property
Topics: | Quick Reference OCR: Working with a Dictionary


DictionaryState property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL DictionaryState
Overview | Refer to Working with a Dictionary

Remarks

(Read only) Indicates whether or not the user dictionary has been changed since it was saved or created. Possible values are:

This property is automatically updated by the engine.

Value | Meaning
TRUE | The user dictionary has been modified since it was last saved, opened, or created.
FALSE | The user dictionary has not been modified.

See Also

Elements: | DictionaryFileName property, GetUserDictionarySectionItem method, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, RemoveItemFromUserDictionary method, DictionaryItemAttribute property, DictionaryDefaultSection property
Topics: | Quick Reference OCR: Working with a Dictionary


DrawPersistence property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL DrawPersistence
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets a value that indicates where the DrawPage method will draw the page. Possible values are:

Setting | Description
TRUE | The DrawPage method will draw the page in the object specified in the pRaster parameter.
FALSE | The DrawPage method will draw the page in the DC specified in the hDC parameter. (Default)

See Also

Elements: | ActivePageIndex property, DrawPage method, EnableShowZones property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


EnableCorrection property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableCorrection
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets a value that indicates whether the correction mode of the checking subsystem is enabled. Possible values are:

Value | Meaning
TRUE | Enables the correction mode of the checking subsystem.
FALSE | Disables the correction mode of the checking subsystem.

See Also

Elements: | EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, EnableProgressStatusEvent property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, ProgressStatus event, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: | Quick Reference OCR: Recognizing Document Pages


EnableFireRecognizeStatus property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableFireRecognizeStatus
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets a value that indicates whether to enable the generation of the RecognitionStatus event. Possible values are:

Setting | Description
TRUE | Enables the generation of the RecognitionStatus event.
FALSE | Disables the generation of the RecognitionStatus event.

The EnableStopRecognizeStatus property is designed to be set within the RecognitionStatus event itself, to stop the current event. The EnableFireRecognizeStatusEvent property is designed to be set outside the RecognitionStatus event to control whether the event is even generated.

See Also

Elements: | EnableSubSystem property, SpellLanguageID property, Recognize method, EnableCorrection property, EnableMethodErrors property, EnableProgressStatusEvent property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, ProgressStatus event, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: | Quick Reference OCR: Recognizing Document Pages


EnableMethodErrors property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableMethodErrors
Overview | Refer to Recognizing Document Pages

Remarks

Specifies whether LEADTOOLS OCR generates system error events (in addition to error return codes).

Setting | Description
TRUE | Generate system error events.
FALSE | Do not generate system error events.

See Also

Elements: | EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableCorrection property, EnableProgressStatusEvent property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, ProgressStatus event, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: | Quick Reference OCR: Recognizing Document Pages


EnableParallelRecognition property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableParallelRecognition
Overview | Recognizing Document Pages

Remarks

Enables or disables the Parallel Recognition Mode of the OCR engine. Possible values are:

Setting | Description
TRUE | Enable the Parallel Recognition Mode. (default)
FALSE | Disable the Parallel Recognition Mode.

If the host PC has two processors or a hyper-threaded one, enabling the Parallel Recognition Mode can speed up the recognition process by allowing the two recognition engines to run in parallel.

The OCR engine may use Parallel Recognition Mode when a zone is associated with any of the following recognition modules:

RECOGMODULE_MTEXT_OMNIFONT

RECOGMODULE_OMNIFONT_FRX

RECOGMODULE_OMNIFONT_PLUS3W

If this property is not set within an application, then by default, parallel recognition is enabled.

To get information on a particular zone, call the GetZoneInfo method. The recognition module associated with the zone is found in the RecognizeModule property of the ILTZoneData object that is updated by the GetZoneInfo method.

See Also

Elements: | Recognize method
Topics: | Recognizing Document Pages
 | Working with Zones
 | Quick Reference OCR: Recognizing Document Pages
 | Quick Reference OCR: Working with Zones


EnableProgressStatusEvent property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableProgressStatusEvent
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Specifies whether LEADTOOLS generates a ProgressStatus event to indicate the completion percentage of the LEADTOOLS method being processed. Possible values are:

Value | Meaning
TRUE | Generate the ProgressStatus event, which can be used to update a status bar or to detect a user interrupt.
FALSE | If this property is set to FALSE during a load process, the load process is canceled. If this property is set to FALSE during any other process (any non-loading process), the ProgressStatus event will not be generated.

See Also

Elements: | EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, EnableProgressStatusEvent property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, ProgressStatus event, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: |


EnableSaveResultsToMemory property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableSaveResultsToMemory
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Gets or sets a value that indicates whether to save the recognition results into memory or a file. Possible values are:

Value | Meaning
TRUE | Save recognition results into memory
FALSE | Save recognition results into file.

To save the recognition results to memory, this property must be set to TRUE before calling the SaveResultsToMemory method.

See Also

Elements: | SaveResultsToMemory method, GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


EnableShowZones property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableShowZones
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets a value that indicates whether the zones will be drawn with the page. Possible values are:

Setting | Description
TRUE | Draw the zones on the page.
FALSE | Do not draw the zones on the page.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


EnableStopRecognizeStatus property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableStopRecognizeStatus
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets a value that indicates whether to enable the generation of the RecognitionStatus event. Possible values are:

Setting | Description
TRUE | Stop firing the RecognitionStatus event.
FALSE | Continue firing the RecognitionStatus event

The EnableStopRecognizeStatus property is designed to be set within the RecognitionStatus event itself, to stop the current event. The EnableFireRecognizeStatusEvent property is designed to be set outside the RecognitionStatus event to control whether the event is even generated.

See Also

Elements: | EnableProgressStatusEvent property, ProgressStatus event, EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, GetRecognizedCharacters method, GetStatus method, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: |


EnableSubSystem property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableSubSystem
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets a value that indicates whether the checking subsystem is enabled. Possible values are:

Value | Meaning
TRUE | Enables the checking subsystem.
FALSE | Disables the checking subsystem.

See Also

Elements: | EnableCorrection, SpellLanguageID, Recognize method
Elements: | EnableProgressStatusEvent property, ProgressStatus event, EnableCorrection property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: |


EnableZoneForceSingleColumn property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableZoneForceSingleColumn
Overview | Refer to Working with Zones

Remarks

Gets or sets a value that indicates whether to force the page to be a single column, when automatically detecting zones. Possible values are:

Value | Meaning
TRUE | Force the page to be a single column.
FALSE | Do not force the page to be a single column. This prevents the engine from detecting columns and placing their contents one below the other. It is useful for conserving the columnar structure in tables

This property is updated by the GetAutoZoneOptions method.

This property must be set before calling the SetAutoZoneOptions method.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, GetZoneInfo method, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


FileFormatInfo property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTFileFormatInfo * FileFormatInfo
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a pointer to an ILTFileFormatInfo object that contains information on a supported file format.

The properties of this ILTFileFormatInfo object are updated by the GetFileFormatInfo method.

The GetOutputFileFormats method enumerates all available output file formats for the engine. For each format enumerated an EnumOutputFileFormats event is generated. Within this event the GetFileFormatInfo method can be called for each enumerated file format and the file format information updated in the FileFormatInfo property.

Since the ILTFileFormatInfo properties accessed by this property are read only, they can only be used to get information about the file format. They cannot be used to change the file format information.

See Also

Elements: | GetOutputFileFormats method, EnumOutputFileFormats event, GetFileFormatInfo method, DLLName property, ExtName property, FormatName property, Type property, GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


HandPrintModuleOptions property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTHandPrintOptions * HandPrintModuleOptions
Overview | Refer to Recognizing Document Pages Refer to Using the Hand Print Options

Remarks

(Read Only) Gets a pointer to an ILTHandPrintOptions object that contains the hand print options for the OCR engine.

The properties of this ILTHandPrintOptions object are updated by the GetHandPrintOptions method.

The HandPrintModuleOptions property itself is read only. However, the properties accessed by this property can be set with new hand print option values and these values set for the OCR engine by calling the SetHandPrintOptions method.

See Also

Elements: | EnableSpace property, CharacterHeight property, CharacterWidth property, CharacterSpace property, RecognizeModule property, RecognizeModuleTradeoff property, GetHandPrintOptions method, HandPrintModuleOptions property, SetOMROptions method, GetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


LanguageCharacterFilter property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | CHARFILTER LanguageCharacterFilter
Overview | Refer to Working with Languages

Remarks

Gets or sets a value that represents a global character set filter. For a list of possible values, refer to CHARFILTER. This filter may be used globally at page-level, or it may be used on a per-zone basis.

If this property is not set before the recognition process starts, this property will default to CHAR_FILTER_ALL and the Language Environment will not be filtered globally.

See Also

Elements: | LanguageCharacterPlus property, LanguageCharacterPlusFilter property.
Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, ActiveLanguage property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


LanguageCharacterPlus property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR LanguageCharacterPlus
Overview | Refer to Working with Languages

Remarks

Gets or sets one or more characters that are added to the set of characters determined by the active language(s). The resulting set of characters is called the Language Environment.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, ActiveLanguage property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


LanguageCharacterPlusFilter property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR LanguageCharacterPlusFilter
Overview | Refer to Working with Languages

Remarks

Gets the Character plus filter attribute from the Character options of the current activated languages in the OCR engine.

Gets or sets a set of "filter plus" characters that define or expand the set of filtered characters used globally or on a per-zone basis.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, ActiveLanguage property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


MemoryRecognitionResult property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR MemoryRecognitionResult
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets the contents of the recognition results that were saved to memory using the SaveResultsToMemory method.

The MemoryRecognitionResultSize property is updated with the length of the recognition results in this property.

See Also

Elements: | MemoryRecognitionResultSize property, GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


MemoryRecognitionResultSize property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryRecognitionResultSize
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets the length of the recognition results that were saved to memory using the SaveResultsToMemory method.

See Also

Elements: | MemoryRecognitionResult property, GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


MOREnableFax property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL MOREnableFax
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that indicates whether the fax image mode is enabled. Possible values are:

Value | Description
TRUE | The fax image mode is enabled.
FALSE | The fax image mode is not enabled.

This property is used only if the RecognizeModule property for the zone is RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT.

See Also

Elements: | RecognizeModuleTradeoff property, SetHandPrintOptions method, GetHandPrintOptions method, SetOMROptions method, GetOMROptions method, Recognize method
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


OMRModuleOptions property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTOMROptions * OMRModuleOptions
Overview | Refer to Recognizing Document Pages Refer to Using the OMR Options

Remarks

(Read only) Gets a pointer to an ILTOMROptions object that contains the OMR options for the OCR engine.

The properties of this ILTOMROptions object are updated by the GetOMROptions method.

The OMRModuleOptions property itself is read only. However, the properties accessed by this property can be set with new OMR option values and these values set for the OCR engine by calling the SetOMROptions method.

See Also

Elements: | EnableFill property, Frame property, SetOMROptions method, RecognizeModule property, GetOMROptions method, RecognizeModuleTradeoff property, GetHandPrintOptions method, SetHandPrintOptions method.
Topics: | Quick Reference OCR: Using the OMR Options


PageBitsPerPixel property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PageBitsPerPixel (short iPageIndex);
Overview | Refer to Working with Pages

Remarks

(Read only) Gets the bits per pixel of the page at the specified index in the OCR document.

The height, width and bits per pixel for each page are maintained internally. This information can be obtained for each page through the PageHeight, PageWidth and PageBitsPerPixel properties.

See Also

Elements: | AddPage method, PageCount property, UpdatePage method, RemovePage method, ExportPage method, PageWidth property, PageHeight property, AutoOrientPage method
Topics: | Quick Reference OCR: Working with Pages


PageCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PageCount
Overview | Refer to Working with Pages

Remarks

(Read only) Gets the total number pages in the OCR document.

This property is updated every time a page is added to or removed from the OCR document using the AddPage method or the RemovePage method.

See Also

Elements: | AddPage method UpdatePage method, RemovePage method, ExportPage method, PageWidth property, PageHeight property, PageBitsPerPixel property.
Topics: | Quick Reference OCR: Working with Pages


PageFillMethod property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | FILL_METHOD PageFillMethod
Overview | Refer to Working with Zones

Remarks

Gets or sets the fill method used by the OCR engine to fill zones of all pages processed by the engine, until the fill method is changed. For a list of possible values, refer to FILL_METHOD.

If a specific zone has a different fill method set in its FillMethod property, then the engine will use the zone's fill method instead of the fill method in the PageFillMethod property.

See Also

Elements: | DefaultPageFillMethod property, ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, GetZoneInfo method, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


PageHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PageHeight (short iPageIndex);
Overview | Refer to Working with Pages

Remarks

(Read only) Gets the height, in pixels, of the page at the specified index in the OCR document.

The height, width and bits per pixel for each page are maintained internally. This information can be obtained for each page through the PageHeight, PageWidth and PageBitsPerPixel properties.

See Also

Elements: | AddPage method, PageCount property, UpdatePage method, RemovePage method, ExportPage method, PageWidth property, PageBitsPerPixel property, AutoOrientPage method
Topics: | Quick Reference OCR: Working with Pages


PageWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PageWidth (short iPageIndex);
Overview | Refer to Working with Pages

Remarks

(Read only) Gets the width, in pixels, of the page at the specified index in the OCR document (internal list of pages).

The height, width and bits per pixel for each page are maintained internally. This information can be obtained for each page through the PageHeight, PageWidth and PageBitsPerPixel properties.

See Also

Elements: | AddPage method, PageCount property, UpdatePage method, RemovePage method, ExportPage method, PageHeight property, PageBitsPerPixelProperty, AutoOrientPage method
Topics: | Quick Reference OCR: Working with Pages


PaintZoomFactor property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float PaintZoomFactor(short iPageIndex)
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the zoom factor used to draw the specified OCR page.

The values for this property represent a zoom factor. A value of 100 represents a normal display; a value of 200 represents a 2X display; a value of 50 represents a 1/2X display; etc.

The page specified in iPageIndex may or may not have zones. If the page has zones, the zones will be drawn using the zoom factor too.

To draw the specified page, using the zoom factor, call the DrawPage method.

See Also

Elements:

DrawPage method, UpdatePage method, ActivePageIndex property, SelectZoneByPoint method, SelectZone method, RemoveSelectedZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, UpdateZoneArea method.


RecognitionDataFileName property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR RecognitionDataFileName
Overview | Refer to Handling the Results of the Recognition Process.

Remarks

Gets or sets the name of the file in which to save the recognition results.

The Recognize method saves the recognition results to the file specified in the RecognitionDataFileName property. When the SaveDocument method is called, the recognition results are read from the file specified in the RecognitionDataFileName property and converted to the final output file specified in the bstrFileName parameter of the SaveDocument method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property property, GetFileFormatInfo method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


RecognizedCharacter property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTRecognizedCharacters * RecognizedCharacter (short iIndex);
Overview | Refer to Using Recognized Characters

Remarks

(Read Only) Gets a pointer to an array of ILTRecognizedCharacters objects that contain the recognized characters for the specified page.

The GetRecognizedCharacters method updates this property and its associated ILTRecognizedCharacters properties.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method, SetRecognizedCharacters method, GetRecognizedCharacters method, RecognizedCharactersCount property
Topics: |


RecognizedCharactersCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedCharactersCount
Overview | Refer to Using Recognized Characters

Remarks

(Read only) Gets the number of recognized characters obtained by the GetRecognizedCharacters method.

The RecognizedCharacter property contains the actual characters obtained by the GetRecognizedCharacters method.

See Also

Elements: | RecognizedCharacter property, GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter method, SpecialMissingSymbol property, GetFileFormatInfo method, SetRecognizedCharacters method, GetRecognizedCharacters
Topics: | Quick Reference OCR: Using Recognized Characters


RecognizedWord property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR RecognizedWord(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of strings, in which each string is one of the recognized words.

The number of words updated in this property can be found in the RecognizedWordsCount property.

Information about each word in the array can be found in the following properties:

RecognizedWordZone property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordWidth property

RecognizedWordHeight property

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWordHeight property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedWordHeight(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of values, in which each value represents the height of one of the recognized words. The unit of measure is pixels.

The recognized words are updated in the RecognizedWord property. For each word in the RecognizedWord property (RecognizedWord(i)), the height of that word is given at the corresponding index of the RecognizedWordHeight property (RecognizedWordHeight(i).

Other information about each recognized word can be found in the following properties:

RecognizedWordZone property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordWidth property

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedWordLeft(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of values, in which each value represents the left coordinate of the origin of one of the recognized words. The unit of measure is pixels.

The recognized words are updated in the RecognizedWord property. For each word in the RecognizedWord property (RecognizedWord(i)), the left coordinate of the origin of that word is given at the corresponding index of the RecognizedWordLeft property (RecognizedWordLeft(i).

Other information about each recognized word can be found in the following properties:

RecognizedWordZone property

RecognizedWordTop property

RecognizedWordHeight property

RecognizedWordWidth property

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWordHeight property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordsCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RecognizedWordsCount
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with the total number of recognized words in the RecognizedWord property.

The value of this property determines the valid values for the iIndex parameters of the following properties:

RecognizedWord property

RecognizedWordHeight property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordWidth property

RecognizedWordZone property

For example, if the RecognizedWordsCount property is updated with the value 4, there are four recognized words on the page specified in the iPageIndex parameter of the GetRecognizedWords method. Since the indexes of the properties listed above are zero-based, the possible values are from 0 to 3.

See Also

Elements: | GetRecognizedWords method, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWordHeight property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedWordTop(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of values, in which each value represents the top coordinate of one of the recognized words. The unit of measure is pixels.

The recognized words are updated in the RecognizedWord property. For each word in the RecognizedWord property (RecognizedWord(i)), the top coordinate of the origin that word is given at the corresponding index of the RecognizedWordTop property (RecognizedWordTop(i).

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordWidth property, RecognizedWordHeight property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedWordWidth(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of values, in which each value represents the width of one of the recognized words. The unit of measure is pixels.

The recognized words are updated in the RecognizedWord property. For each word in the RecognizedWord property (RecognizedWord(i)), the width of that word is given at the corresponding index of the RecognizedWordWidth property (RecognizedWordWidth(i).

Other information about each recognized word can be found in the following properties:

RecognizedWordZone property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordHeight property

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordHeight property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizedWordZone property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RecognizedWordZone(short iIndex)
Overview | Refer to Working with Recognized Words

Remarks

(Read only) This property is updated by the GetRecognizedWords method with an array of values, in which each value represents the zone of one of the recognized words.

The recognized words are updated in the RecognizedWord property. For each word in the RecognizedWord property (RecognizedWord(i)), the zone in which that word is located is given at the corresponding index of the RecognizedWordZone property (RecognizedWordZone(i).

Other information about each recognized word can be found in the following properties:

RecognizedWordHeight property

RecognizedWordLeft property

RecognizedWordTop property

RecognizedWordWidth property

See Also

Elements: | GetRecognizedWords method, RecognizedWordsCount property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWordHeight property, RecognizedWord property
Topics | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


RecognizeModuleTradeoff property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | RECOG_MODULE_TRADEOFF RecognizeModuleTradeoff
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets the current trade-off setting for the OCR engine. For a list of possible values, refer to RECOG_MODULE_TRADEOFF.

This trade-off setting is applied during automatic zoning and recognition. To automatically detect zones on a specific page, call the FindZones method. To recognize one or more pages, call the Recognize method.

The OCR engine trade-off setting is effective for the following recognition modules:

RECOGNIZE_MODULE_MTEXT_OMNIFONT: omnifont multi-lingual module.

RECOGNIZE_MODULE_MULTI_LINGUAL_OMNIFONT: omnifont module.

RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL: handprinted numeral module.

RECOGNIZE_MODULE_RER_PRINTED: handprint module.

This setting does not influence the behavior of any other RECOGMODULE recognition modules. Not all of the above modules interpret the settings in the same way.

If this property is not set before calling the Recognize method, the default value RECOG_MODULE_ACCURATE is applied.

See Also

Elements: | SetOMROptions method, GetOMROptions method, SetHandPrintOptions method, GetHandPrintOptions method, Recognize method, FindZones method
Topics: |


RecognizeStatus property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTRecognizeStatus * RecognizeStatus
Overview | Refer to Getting Status Updates

Remarks

(Read Only) Gets a pointer to an ILTRecognizeStatus object that contains information on the most recent recognition process.

The properties of this ILTRecognizeStatus object are updated by the GetStatus method.

See Also

Elements: | GetStatus method, Recognize method, RecognizeStatus property, RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, SaveResultsToMemory method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo, SaveDocument method, SpecialRejectedCharacter property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Getting Status Updates


ResultOptions property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTResultOptions* ResultOptions
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a pointer to an ILTResultOptions object that contains the options used by the OCR engine when saving the recognition results.

The properties of this ILTResultOptions object are updated by the GetRecognitionResultOptions method.

The ResultOptions property itself is read only. However, the properties accessed by this property can be set with new result option values and these values set for the OCR engine by calling the SetRecognitionResultOptions method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process Quick Reference OCR: Using the Document Options Quick Reference OCR: Using the Paragraph Options Quick Reference OCR: Using the Character Options Quick Reference OCR: Using the Mark Options


ScaleMode property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | RasterScaleModeConstants ScaleMode
Overview | Refer to Drawing Pages and Zones

Remarks

Specifies the unit of measure for the LEAD Raster Document object.

You can change the unit of measure at any time without affecting measurements that the object maintains. The object accepts floating point values and converts them to pixels internally. This means, for example, that if you set a property value in twips, the value that you get back may be slightly different, since it is rounded to the nearest pixel.

ScaleMode is used with the following properties:

SourceLeft property

SourceTop property

SourceWidth property

SourceHeight property

SourceClipLeft property

SourceClipTop property

SourceClipWidth property

SourceClipHeight property

DestinationLeft property

DestinationTop property

DestinationWidth property

DestinationHeight property

DestinationClipLeft property

DestinationClipTop property

DestinationClipWidth property

DestinationClipHeight property

See Also

Elements: | UpdatePage method, ActivePageIndex property, SelectZone method, RemoveSelectedZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, UpdateZoneArea method.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectedLanguages property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS SelectedLanguages (short iIndex);
Overview | Refer to Working with Languages

Remarks

(Read only) Gets an array of IDs that represent the current active languages for the OCR engine. For a list of possible values, refer to LANG_IDS.

This property is updated by the SelectLanguages method.

See Also

Elements: | ActiveLanguagesCount property, ActiveLanguage property, SelectedLanguagesCount property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


SelectedLanguagesCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectedLanguagesCount
Overview | Refer to Working with Languages

Remarks

(Read only) Gets the number of selected languages in the SelectedLanguages property.

This property is updated by the engine.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, ActiveLanguage property, DefaultSpellLanguages property, DefaultSpellLanguagesCount property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


SelectedZone property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTZoneData * SelectedZone (short iPageIndex);
Overview | Refer to Drawing Pages and Zones

Remarks

(Read Only) Gets a pointer to an ILTZoneData object that contains the selected zone.

This property is updated by the SelectZone method and the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectedZonePenColor property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR SelectedZonePenColor
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the color of the pen used to draw selected zones.

Set this property before calling the DrawPage method to set the color of the pen used to draw selected zones.

To specify the color to use when drawing zones, set the ZonePenColor property.

To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectedZonePenStyle property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectedZonePenStyle
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the style of the pen used to draw selected zones.

Set this property before calling the DrawPage method to set the style of the pen used to draw selected zones.

To specify the style to use when drawing zones, set the ZonePenStyle property.

To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectedZonePenWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectedZonePenWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the width of the pen used to draw selected zones.

Set this property before calling the DrawPage method to set the width of the pen used to draw selected zones.

To specify the width to use when drawing zones, set the ZonePenWidth property.

To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectZoneIndex property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectZoneIndex
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the index of the selected zone.

This property is updated by the SelectZoneByPoint method and by the SelectZone method.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method.
Topics: | Quick Reference OCR: Drawing Pages and Zones


ShowZoneGridLines property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL ShowZoneGridLines
Overview | Refer to Working with Zones

Remarks

Gets or sets a value that indicates whether to make the grid lines visible when automatically detecting zones. Possible values are:

Setting | Description
TRUE | Make the grid lines visible.
FALSE | Make the grid lines invisible.

This property is updated by the GetAutoZoneOptions method.

This property must be set before calling the SetAutoZoneOptions method.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, GetZoneInfo method, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


SourceClipHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceClipHeight
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the height of the clipping rectangle that determines the portion of the source display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceClipLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceClipLeft
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the left boundary of the clipping rectangle that determines the portion of the source display that will be painted by the DrawPage method.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceClipTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceClipTop
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the top boundary of the clipping rectangle that determines the portion of the source display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceClipWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceClipWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the width of the clipping rectangle that determines the portion of the source display that will be painted by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceHeight
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the height of the source page to be drawn by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceLeft
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the left boundary of the source page to be drawn by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceTop
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the top boundary of the source page to be drawn by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SourceWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SourceWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the width of the source page to be drawn by the DrawPage.

See Also

Elements: | UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ScaleMode property.
Topics: | Quick Reference OCR: Drawing Pages and Zones


SpecialMissingSymbol property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SpecialMissingSymbol
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets the character used to replace missing characters in both the recognition process and when saving the recognition results.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, GetFileFormatInfo method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Recognizing Document Pages


SpecialRejectedCharacter property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SpecialRejectedCharacter
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets the character used to replace rejected characters in both the recognition process and when saving the recognition results.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialMissingSymbol property, GetFileFormatInfo method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Recognizing Document Pages


SpellLanguageID property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS SpellLanguageID
Overview | Refer to Recognizing Document Pages

Remarks

Gets or sets a value that indicates the language the checking subsystem will use for spell-checking. For a list of possible values, refer to LANG_IDS.

The default language is English.

See Also

Elements: | EnableSubSystem property, EnableCorrection property, Recognize method
Topics: | Quick Reference OCR: Recognizing Document Pages


StopProgressStatusEvent property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL StopProgressStatusEvent
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Gets or sets a value that indicates whether to stop firing the ProgressStatus event.

Setting | Description
TRUE | Stop generating the ProgressStatus event.
FALSE | Continue firing the ProgressStatus event.

This property is designed to be set within the ProgressStatus event itself, to stop the current event. The EnableProgressStatusEvent property is designed to be set outside the ProgressStatus event to control whether the event is even generated.

See Also

Elements: | EnableProgressStatusEvent property, ProgressStatus event, EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: |


ZoneCount property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ZoneCount (short iPageIndex);
Overview | Refer to Working with Zones

Remarks

(Read only) Gets the number of zones in the zone list of the specified page.

This property is maintained internally and automatically updated when a zone is added to or removed from a page using the AddZone method or the RemoveZone method.

See Also

Elements: | GetZoneInfo method, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


ZoneHeight property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ZoneHeight
Overview | Refer to Working with Zones

Remarks

Gets or sets the height of the area in which the FindZones method will search for zones.

This property will be used only if the bUseImageArea parameter of the FindZones method is FALSE.

The other properties used to define the search area are:

ZoneLeft property

ZoneTop property

ZoneWidth property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, GetZoneInfo method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneHeight property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


ZoneLeft property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ZoneLeft
Overview | Refer to Working with Zones

Remarks

Gets or sets the left boundary of the area in which the FindZones method will search for zones.

This property will be used only if the bUseImageArea parameter of the FindZones method is FALSE.

The other properties used to define the search area are:

ZoneHeight property

ZoneTop property

ZoneWidth property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, GetZoneInfo method, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


ZoneParser property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | PAGE_PARSER ZoneParser
Overview | Refer to Working with Zones

Remarks

Gets or sets a value that represents the page parser algorithm used by the OCR engine when automatically detecting zones. For a list of possible values, refer to PAGE_PARSER.

This property is updated by the GetAutoZoneOptions method.

This property must be set before calling the SetAutoZoneOptions method.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, GetZoneInfo method
Topics: | Quick Reference OCR: Working with Zones


ZonePenColor property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR ZonePenColor
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the color of the pen used to draw zones.

Set this property before calling the DrawPage method to set the color used to draw zones.

To specify the pen color to use when drawing selected zones, set the SelectedZonePenColor property. To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetSelectedZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


ZonePenStyle property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ZonePenStyle
Overview | Refer to Drawing Pages and Zones

Remarks

Gets or sets the style of the pen used to draw zones.

Set this property before calling the DrawPage method to set the style of the pen used to draw zones.

To specify the style to use when drawing selected zones, set the SelectedZonePenStyle property. To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetSelectedZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


ZonePenWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ZonePenWidth
Overview | Refer to Drawing Pages and Zones

Remarks

Sets and Gets the width of the pen that will be used in drawing zones.

Gets or sets the width of the pen used to draw zones.

Set this property before calling the DrawPage method to set the width of the pen used to draw zones.

To specify the pen width to use when drawing selected zones, set the SelectedZonePenStyle property. To draw a specific selected zone call the SelectZone method or the SelectZoneByPoint method.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetSelectedZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property
Topics: | Quick Reference OCR: Drawing Pages and Zones


ZoneTop property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ZoneTop
Overview | Refer to Working with Zones

Remarks

Gets or sets the top boundary of the area in which the FindZones method will search for zones.

This property will be used only if the bUseImageArea parameter of the FindZones method is FALSE.

The other properties used to define the search area are:

ZoneHeight property

ZoneLeft property

ZoneWidth property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, GetZoneInfo method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


ZoneWidth property (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ZoneWidth
Overview | Refer to Working with Zones

Remarks

Gets or sets the width of the area in which the FindZones method will search for zones.

This property will be used only if the bUseImageArea parameter of the FindZones method is FALSE.

The other properties used to define the search area are:

ZoneHeight property

ZoneLeft property

ZoneTop property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, GetZoneInfo method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


AddItemToUserDictionary method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddItemToUserDictionary (BSTR bstrSection, BSTR bstrUIDitem);
Overview | Refer to Working with a Dictionary

Remarks

Adds a new item to the specified section of the user dictionary that is currently open. The item will be added to the section of the user dictionary specified in the bstrSection parameter.

User dictionary items are UNICODE strings and they must be no longer than MAX_UD_ITEM_LENGTH characters (including the terminating zero). They may contain spaces and punctuation characters.

An item can be added either as a literal or as a regular expression. To determine whether an item is added as a literal or as a regular expression, set the DictionaryItemAttribute property before calling the SetUserDictionary method to save the user dictionary. User dictionary items having the regular expression attribute will be evaluated for conformance during the checking of the recognized result.

See Also

Elements: | DictionaryDefaultSection property, DictionaryFileName property, DictionaryItemAttribute property, DictionaryState property, SetUserDictionary method, GetUserDictionarySectionItem method, GetUserDictionarySection method, RemoveItemFromUserDictionary method.
Topics: | Quick Reference OCR: Working with a Dictionary


AddPage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddPage (IDispatch *pRaster, short iPageIndex);
Overview | Refer to Working with Pages

Remarks

Adds a new page to the internal list of pages that make up the OCR document.

After this method returns, the PageCount property is updated with the new total number of pages in the OCR document.

This method checks the color order for each image. If any image's color order is inversed (i.e. white to black) then the method will convert the color order to be normal (i.e. black to white).

See Also

Elements: | UpdatePage method, RemovePage method, ExportPage method, AutoOrientPage method, PageCount property
Topics: | Quick Reference OCR: Working with Pages


AddZone method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddZone (short iPageIndex, short iZoneIndex, ILTZoneData *pZone);
Overview | Refer to Working with Zones

Remarks

Adds a new zone in the zone list of the specified page. After the zone is added, the zone list is recalculated automatically.

The information that defines the zone to add is passed to the method in the pZone parameter, a pointer to an ILTZoneData object /interface. For more information on the properties of this object/interface, refer to ILTZoneData.

See Also

Elements: | ZoneCount property, GetZoneInfo method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


AutoOrientPage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AutoOrientPage (short iPageIndex,);
Overview | Refer to Working with Pages

Remarks

Automatically orients (rotates) the specified page to be readable and updates the image data.

See Also

Elements: | AddPage method, PageCount property, RemovePage method, ExportPage method, UpdatePage method
Topics: | Quick Reference OCR: Working with Pages


DrawPage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DrawPage (IDispatch *pRaster, long hDC, short iPageIndex);
Overview | Refer to Drawing Pages and Zones

Remarks

Displays the specified page with or without its zones, at any size, to any device context (screen, printer, or memory DC). If the display surface has fewer colors than the image, this method dithers the output to that display surface without affecting the actual image data.

Before calling this method, the page that will be drawn must be activated by setting the ActivePageIndex property to the appropriate index.

If the ActivePageIndex property is not set to the appropriate page index before calling this method, this method will return the ERROR_DOC_ACTIVE_PAGE error.

See Also

Elements: | ActivePageIndex property, DrawPersistence property, EnableShowZones property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, RemoveSelectedZone method, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


ExportPage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ExportPage (IDispatch *pRaster, short iPageIndex);
Overview | Refer to Working with Pages

Remarks

Exports the specified page to the specified raster object.

See Also

Elements: | AddPage method, PageCount property, RemovePage method, UpdatePage method, AutoOrientPage method
Topics: | Quick Reference OCR: Working with Pages


ExportZones method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ExportZones (short iPageIndex, BSTR bstrFileName);
Overview | Refer to Working with Zones

Remarks

Exports the zone list of the specified page into a zone file.

Zones that have been exported using this method can be imported using the ImportZones method.

The zone files are created by the underlying ScanSoft engine. The bstrFileName parameter should include the file extension.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, GetZoneInfo method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


FindZones method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FindZones (short iPageIndex, BOOL bUseImageArea);
Overview | Refer to Working with Zones

Remarks

Automatically detects all zones in the specified area of the specified page.

The method performs the analysis within the specified area of the image. It finds text or graphics blocks within the specified area. Zones found by this method are entered in a sequential list, called the zone list, which is attached to the specified page.

If the bUseImageArea parameter is FALSE, then the FindZones method will search for zones inside the area specified by the following properties:

ZoneLeft property

ZoneTop property

ZoneWidth property

ZoneHeight property

If the bUseImageArea parameter is TRUE, then the FindZones method will search the entire page for zones.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, GetZoneInfo method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


GetAutoZoneOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetAutoZoneOptions ();
Overview | Refer to Working with Zones

Remarks

Gets the automatic zoning options used by the OCR engine.

Call the FindZones method to automatically detect zones.

To set the automatic zoning options, call the SetAutoZoneOptions method.

This method automatically updates the following properties with the automatic zoning options:

ZoneParser property

EnableZoneForceSingleColumn property

ShowZoneGridLines property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetZoneInfo method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


GetFileFormatInfo method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetFileFormatInfo (FORMATTYPE Format);
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Gets detailed information about the specified output format.

The GetOutputFileFormats method enumerates all output file formats supported by the engine. For each format enumerated by the GetOutputFileFormats method an EnumOutputFileFormats event is generated. Within the EnumOUtputFileFormats event the user can call the GetFileFormatInfo method to update the FileFormatInfo property with information about the enumerated file format.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


GetHandPrintOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetHandPrintOptions ();
Overview | Refer to Recognizing Document Pages Refer to Using the Hand Print Options

Remarks

Gets the current hand print options used by the OCR engine.

This method updates the HandPrintModuleOptions property with the current settings.

To update the hand print options, set the properties referenced by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

These options will be used only when the RecognizeModule property for a zone is RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL.

See Also

Elements: | EnableSpace property, CharacterHeight property, CharacterWidth property, CharacterSpace property, RecognizeModule property, RecognizeModuleTradeoff property, SetHandPrintOptions method, HandPrintModuleOptions property, SetOMROptions method, GetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


GetOMROptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetOMROptions ();
Overview | Refer to Recognizing Document Pages Refer to Using the OMR Options

Remarks

Gets the current OMR options used by the OCR engine.

This method updates the OMRModuleOptions property with the current settings.

To update the OMR options, set the properties referenced by the OMRModuleOptions property and call the SetOMROptions method.

These options will be used only when the RecognizeModule property for a zone is RECOGNIZE_MODULE_OMR.

To update the OMR options, call the SetOMROptions method.

See Also

Elements: | EnableFill property, Frame property, SetOMROptions method, RecognizeModule property, OMRModuleOptions property, RecognizeModuleTradeoff property, GetHandPrintOptions method, SetHandPrintOptions method.
Topics: | Quick Reference OCR: Using the HandPrint Options


GetOutputFileFormats method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetOutputFileFormats ();
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Enumerates all available output file formats in the OCR engine.

For each format enumerated by this method an EnumOutputFileFormats event is generated. Within the EnumOUtputFileFormats event the user can call the GetFileFormatInfo method to update the FileFormatInfo property with information about the enumerated file format.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


GetRecognitionResultOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetRecognitionResultOptions ();
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Gets the current options used by the OCR engine to save the recognition results.

This method updates the ResultOptions property with the current settings.

To update the recognition result options, set the properties referenced by the ResultOptions property and call the SetRecognitionResultOptions method.

See Also

Elements: | ResultOptions property, SetRecognitionResultOptions method, GetStatus method, Recognize method, SetRecognizedCharacters method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method
Topics: | Quick Reference OCR: Using the Document Options Quick Reference OCR: Handling the Results of the Recognition Process Quick Reference OCR: Using the Paragraph Options Quick Reference OCR: Using the Character Options Quick Reference OCR: Using the Mark Options


GetRecognizedCharacters method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetRecognizedCharacters (short iPageIndex);
Overview | Refer to Using Recognized Characters

Remarks

Gets all recognized characters for the specified page.

This method updates the RecognizedCharacter property and its associated ILTRecognizedCharacters properties.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, GetFileFormatInfo method, SetRecognizedCharacters method., EnableProgressStatusEvent property, ProgressStatus event, EnableSubSystem property, SpellLanguageID property, Recognize method, EnableFireRecognizeStatus property, EnableMethodErrors property, EnableStopRecognizeStatus property, GetRecognizedCharacters method, GetStatus method, RecognitionStatus event, RecognizedCharacter property, RecognizeModuleTradeOff property, SpecialMissingSymbol property, SpecialRejectedCharacter property, StopProgressStatusEvent property, Verification event
Topics: |


GetRecognizedWords method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetRecognizedWords(short iPageIndex)
Overview | Refer to Working with Recognized Words

Remarks

Gets all recognized words for the specified recognized page.

This method should only be called after successfully starting a recognition process by calling the Recognize method.

This method updates the following properties with information about the recognized words for the specified page.

RecognizedWord property

RecognizedWordHeight property

RecognizedWordLeft property

RecognizedWordsCount property

RecognizedWordTop property

RecognizedWordWidth property

RecognizedWordZone property

The GetRecognizedWords method just combines the recognized characters for the specified page into words. To change the contents of the recognized words, change the set of recognized characters by calling the SetRecognizedCharacters method. To save the updated recognized characters to a file, call the SaveDocument method. To save the results into memory, call the SaveResultsToMemory method.

See Also

Elements: | RecognizedWordsCount property, RecognizedWordZone property, RecognizedWordLeft property, RecognizedWordTop property, RecognizedWordWidth property, RecognizedWordHeight property, RecognizedWord property, Recognize method, SetRecognizedCharacters method, SaveDocument method, SaveResultsToMemory method
Topics: | Quick Reference OCR: Working with Recognized Words
 | Using Recognized Characters


GetStatus method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetStatus ();
Overview | Refer to Recognizing Document Pages Refer to Getting Status Updates

Remarks

Gets information about the accuracy and timing data of the last recognition process.

Call this method after calling the Recognize method.

This method updates the RecognizeStatus property with the current settings.

See Also

Elements: | Recognize method, RecognizeStatus property, RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property property, PreProcessTime property, DecompositionTime property, SaveResultsToMemory method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo, SaveDocument method, SpecialRejectedCharacter property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: |


GetUserDictionarySection method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR GetUserDictionarySection (long lSize, BOOL bFirst);
Overview | Refer to Working with a Dictionary

Remarks

Returns a string that contains the name of a section in the current user dictionary.

This method gets either the first section in the user dictionary or the next section in the user dictionary, based on the bFirst parameter.

Call this method with the bFirst parameter set to true to get the name of the first section. Then, within a loop, call this method with bFirst set to false to get the name of each remaining section.

See Also

Elements: | DictionaryFileName property, DictionaryState property, SetUserDictionary method, GetUserDictionarySectionItem method, AddItemToUserDictionary method, RemoveItemFromUserDictionary method, DictionaryDefaultSection property, DictionaryItemAttribute property
Topics: | Quick Reference OCR: Working with a Dictionary


GetUserDictionarySectionItem method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR GetUserDictionarySectionItem (BSTR bstrSection, long lSize, BOOL bFirst);
Overview | Refer to Working with a Dictionary

Remarks

Gets a section item from the specified section of the user dictionary.

See Also

Elements: | DictionaryFileName property, DictionaryState property, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, RemoveItemFromUserDictionary method, DictionaryItemAttribute property, DictionaryDefaultSection property
Topics: | Quick Reference OCR: Working with a Dictionary


GetZoneInfo method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetZoneInfo (short iPageIndex, short iZoneIndex, ILTZoneData * pZone);
Overview | Refer to Working with Zones

Remarks

Gets information about the zone at the specified index in the zone list of the specified page.

For more information on the properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


ImportZones method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ImportZones (short iPageIndex, BSTR bstrFileName);
Overview | Refer to Working with Zones

Remarks

Imports the zone list from a zone file into the specified page.

This method removes any zone list already attached to the specified page.

The ImportZones method only imports zone files created using the ExportZones method.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, GetZoneInfo method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


IsCharacterEnabled method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL IsCharacterEnabled (BSTR ch);
Overview | Refer to Working with Languages

Remarks

Determines whether the specified character is enabled in the OCR engine.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, ActiveLanguage property, DefaultSpellLanguagesCount property, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, SelectLanguages method
Topics: | Quick Reference OCR: Working with Languages


LoadSettingsFile method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadSettingsFile (BSTR bstrFileName);
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Loads settings from an OCR engine settings file that was previously saved using the SaveSettingsFile method.

See Also

Elements: | SaveSettingsFile
Topics: | Quick Reference OCR: Starting and Shutting Down the Engine


OffsetZones method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OffsetZones (short x, short y);
Overview | Refer to Working with Zones

Remarks

Scrolls the zones of the currently displayed page, by the specified values.

When a page is scrolled, the zones on that page must also be scrolled and redrawn in their new locations, relative to the page. The amount the page was scrolled indicates the amount by which the zones must be scrolled. This amount is specified in the X and Y parameters.


Recognize method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Recognize (short iStartPage, short iPageCount);
Overview | Refer to Recognizing Document Pages

Remarks

Recognizes the specified page or pages in the OCR document.

The following property must be set before calling the Recognize method:

RecognitionDataFileName property

For more information on the steps to take before recognizing one or more pages, refer to Programming with LEADTOOLS OCR COM.

To save the recognition results to a file, call the SaveDocument method.

To save the recognition results to memory instead of a file, set the EnableSaveResultsToMemory property to TRUE and call the SaveResultsToMemory method.

See Also

Elements: | GetStatus method, SaveResultsToMemory method, SaveResultsToMemory method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method, RecognitionDataFileName property, RecognizedCharacterCount property, RecognizedWordCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: |


RemoveItemFromUserDictionary method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RemoveItemFromUserDictionary (BSTR bstrSection, BSTR bstrUDitem);
Overview | Refer to Working with a Dictionary

Remarks

Removes the specified item from the specified section in the user dictionary.

To add an item to the user dictionary, use the AddItemToUserDictionary method.

See Also

Elements: | DictionaryFileName property, GetUserDictionarySectionItem method, SetUserDictionary method, AddItemToUserDictionary method, GetUserDictionarySection method, DictionaryState property, DictionaryItemAttribute property, DictionaryDefaultSection property
Topics: | Quick Reference OCR: Working with a Dictionary


RemovePage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RemovePage (short iPageIndex);
Overview | Refer to Working with Pages

Remarks

Removes the specified page from the OCR document.

After this method returns, the PageCount property is updated with the new total number of pages in the OCR document.

To add a page to the OCR document, use the AddPage method.

To export a page to an object, use the ExportPage method.

See Also

Elements: | AddPage method, UpdatePage method, ExportPage method, PageCount property.
Topics: | Quick Reference OCR: Working with Pages


RemoveSelectedZone method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RemoveSelectedZone (short iPageIndex);
Overview | Refer to Drawing Pages and Zones

Remarks

Deletes the selected zone from the zone list in the specified page.

See Also

Elements: | UpdatePage method, ActivePageIndex property, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, UpdateZoneArea method.
Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZonePenColor property, SelectedZonePenStyle property, SelectedZonePenWidth property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectZone method, SetZonePen method, SetSelectedZonePen method, SelectedZone property, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


RemoveZone method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RemoveZone (short iPageIndex, short iZoneIndex);
Overview | Refer to Working with Zones

Remarks

Removes one or more zones from the zone list for the specified page.

Pass –1 for the iZoneIndex parameter to remove all zones.

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, GetZoneInfo method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


SaveDocument method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveDocument (BSTR bstrFileName);
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Saves the recognition results to the specified file.

The Recognize method saves the recognition results to the file specified in the RecognitionDataFileName property. When the SaveDocument method is called, the recognition results are read from the file specified in the RecognitionDataFile property and converted to the final output file specified in the bstrFileName parameter of the SaveDocument method.

To save the recognition results to memory instead of a file, set the EnableSaveResultsToMemory property to TRUE and call the SaveResultsToMemory method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, GetFileFormatInfo method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method, SaveResultsToMemory method, EnableSaveResultsToMemory property
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


SaveResultsToMemory method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveResultsToMemory ();
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Saves the results of the last recognition process to memory.

The EnableSaveResultsToMemory property must be set to TRUE before calling this method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, GetOutputFileFormats method, GetFileFormatInfo method, SaveDocument method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetRecognizedCharacters method, SetRecognizedCharacters method.
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


SaveSettingsFile method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveSettingsFile (BSTR bstrFileName);
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Saves the current engine settings to a file.

To load the engine settings from a file, call LoadSettingsFile. The StartUp method must be called before calling the SaveSettingsFile method. If the SaveSettingsFile method is called after the StartUp method, but before the engine settings have been set, the settings file will contain the default settings.

Some of the engine settings that may be set before calling this method include, but are not limited to, the following:

CharacterOptions property

DocumentOptions property

MarkOptions property

PageFillMethod property

ParagraphOptions property

See Also

Elements: | StartUp method, LoadSettingsFile method
Topics: | Quick Reference OCR: Starting and Shutting Down the Engine


SelectLanguages method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectLanguages ();
Overview | Refer to Working with Languages

Remarks

Makes the languages specified in the ActiveLanguage property the "active" languages for the OCR engine.

This method updates the SelectedLanguages property.

See Also

Elements: | ActiveLanguagesCount property, SelectedLanguages property, SelectedLanguagesCount property, DefaultSpellLanguages property, ActiveLanguage property, IsCharacterEnabled method, LanguageCharacterFilter property, LanguageCharacterPlus property, LanguageCharacterPlusFilter property, DefaultSpellLanguagesCount property
Topics: | Quick Reference OCR: Working with Languages


SelectZoneByPoint method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectZoneByPoint (IDispatch *pRaster, long hDC, short iPageIndex, float x, float y);
Overview | Refer to Drawing Pages and Zones

Remarks

Draws a selection rectangle around the zone located at the specified point.

This method updates the SelectedZone property and the SelectZoneIndex property with information on the zone located at the specified point.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SelectZone method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectZone (IDispatch *pRaster, long hDC, short iPageIndex, short iZoneIndex, BOOL bSelect);
Overview | Refer to Drawing Pages and Zones

Remarks

Selects or deselects the specified zone and draws it in the specified hDC.

This method updates the SelectedZone property and the SelectZoneIndex property with information on the specified zone.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZoneByPoint method, SelectedZonePenWidth property, SetZonePen method, SetSelectedZonePen method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SetAutoZoneOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetAutoZoneOptions ();
Overview | Refer to Working with Zones

Remarks

Sets the automatic zoning options for the OCR engine.

This following properties should be set with the desired automatic zoning options before calling the SetAutoZoneOptions method:

ZoneParser property

EnableZoneForceSingleColumn property

ShowZoneGridLines property

See Also

Elements: | ZoneCount property, AddZone method, UpdateZone method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetZoneInfo method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


SetHandPrintOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetHandPrintOptions ();
Overview | Refer to Recognizing Document Pages Refer to Using the Hand Print Options

Remarks

Sets the hand print options used by the OCR engine.

This method will be used only when the RecognizeModule property for a zone is RECOGNIZE_MODULE_HAND_PRINTED_NUMERAL.

To get the current hand print options, call the GetHandPrintOptions method.

To set new hand print options get the current options by calling the GetHandPrintOptions method. This will update the HandPrintModuleOptions property. This property provides access to the ILTHandPrintOptions properties. Set these ILTHandPrintOptions properties to the new values and then call the SetHandPrintOptions method.

To recognize a page, call the Recognize method.

See Also

Elements: | EnableSpace property, CharacterHeight property, CharacterWidth property, CharacterSpace property, RecognizeModule property, RecognizeModuleTradeoff property, GetHandPrintOptions method, HandPrintModuleOptions property, SetOMROptions method, GetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


SetOMROptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetOMROptions ();
Overview | Refer to Recognizing Document Pages Refer to Using the OMR Options

Remarks

Sets the OMR options used by the OCR engine.

This method will be used only when the RecognizeModule property for a zone is RECOGNIZE_MODULE_OMR.

To get the current OMR options, call the GetOMROptions method.

To set new OMR options get the current options by calling the GetOMROptions method. This will update the OMRModuleOptions property. This property provides access to the ILTOMROptions properties. Set these ILTOMROptions properties to the new values and then call the SetOMROptions method.

To recognize a page, call the Recognize method.

See Also

Elements: | EnableFill property, Frame property, OMRModuleOptions property, RecognizeModule property, GetOMROptions method, RecognizeModuleTradeoff property, GetHandPrintOptions method, SetHandPrintOptions method.
Topics: | Quick Reference OCR: Using the OMR Options


SetRecognitionResultOptions method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetRecognitionResultOptions ();
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Sets options used by the OCR engine when saving recognition results to a file.

To get the current recognition results options, call the GetRecognitionResultOptions method.

To set new recognition results options get the current options by calling the GetRecognitionResultOptions method. This will update the ResultOptions property. This property provides access to the ILTResultOptions properties. Set these ILTResultOptions properties to the new values and then call the SetRecognitionResultOptions method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognizedCharacters method, GetRecognitionResultOptions method, ResultOptions property, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process Quick Reference OCR: Using the Document Options Quick Reference OCR: Using the Paragraph Options Quick Reference OCR: Using the Character Options Quick Reference OCR: Using the Mark Options


SetRecognizedCharacters method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetRecognizedCharacters (short iPageIndex);
Overview | Refer to Using Recognized Characters

Remarks

Sets the recognized characters for a specific recognized page.

The GetRecognizedCharacters updates the RecognizedCharacter with the current set of recognized characters for a specific page. The RecognizedCharacter property is itself read only, but the ILTRecognizedCharacters properties accessed through the RecognizedCharacter property can be changed and the new values set for a specific page using the SetRecognizedCharacters method.

See Also

Elements: | GetStatus method, Recognize method, SetRecognitionResultOptions method, GetRecognitionResultOptions method, SaveResultsToMemory method, SaveDocument method, GetOutputFileFormats method, SpecialRejectedCharacter property, SpecialMissingSymbol property, GetFileFormatInfo method, GetRecognizedCharacters method, RecognizedCharacter property, RecognizedCharactersCount property
Topics: | Quick Reference OCR: Using Recognized Characters


SetSelectedZonePen method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetSelectedZonePen ();
Overview | Refer to Drawing Pages and Zones

Remarks

Sets the pen used to draw selected zones based on the values in the SelectedZonePenColor, SelectedZonePenStyle and SelectedZonePenWidth properties.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


SetUserDictionary method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetUserDictionary (BOOL bCreateUD);
Overview | Refer to Working with a Dictionary

Remarks

Creates a new user dictionary in memory, opens an existing user dictionary, or saves a user dictionary to a file.

To create a new user dictionary in memory, call this method with the bCreateUD parameter set to TRUE. (If there is currently a user dictionary open, this method will save that dictionary in the file specified in the DictionaryFileName property, disable that user dictionary and create a new one.

To open an existing user dictionary stored in a file, set the DictionaryFileName property to the name of the file to load and call this method with the bCreateUD parameter set to FALSE.

To save a newly created user dictionary that contains items added using the AddItemToUserDictionary method,

Set the DictionaryFileName property to the name of the file in which to save the user dictionary

Set the DictionaryDefaultSection property to the desired section name in the user dictionary

Set the DictionaryItemAttribute property to indicate whether to save the added items as literals or regular expressions

Call this method with the bCreateUD parameter set to FALSE to save the dictionary to the file.

See Also

Elements: | DictionaryFileName property, DictionaryState property, GetUserDictionarySection method, GetUserDictionarySectionItem method, AddItemToUserDictionary method, RemoveItemFromUserDictionary method, DictionaryDefaultSection property, DictionaryItemAttribute property
Topics: | Quick Reference OCR: Working with a Dictionary


SetZonePen method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetZonePen ();
Overview | Refer to Drawing Pages and Zones

Remarks

Sets the pen used to draw zones based on the values in the ZonePenColor, ZonePenStyle and ZonePenWidth properties.

Call this method to set the zone pen before calling any method that draws a zone or a page.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, UpdateZoneArea method, SelectZone method, SelectedZonePenWidth property, SetSelectedZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


ShutDown method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ShutDown ();
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Shuts down the OCR document engine and frees the allocated OCR document data.

For each call to StartUp there must be a call to ShutDown. This method should be the last OCR method to be called in the application. It will clean up and free memory allocated during the OCR session and will close (shut down) the OCR document engine

See Also

Elements: | StartUp method
Topics: | Quick Reference OCR: Starting and Shutting Down the Engine


StartUp method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short StartUp ();
Overview | Refer to Starting and Shutting Down the Engine

Remarks

Starts and initializes the OCR document engine.

For each call to StartUp there must be a call to ShutDown.

The StartUp method must be called before calling any other LEADTOOLS OCR toolkit properties, methods or events.

See Also

Elements: | ShutDown method
Topics: | Quick Reference OCR: Starting and Shutting Down the Engine


UpdatePage method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UpdatePage (IDispatch *pRaster, short iPageIndex);
Overview | Refer to Working with Pages

Remarks

Updates the page at the specified index with a new image in pRaster.

See Also

Elements: | AddPage method, PageCount property, RemovePage method, ExportPage method, AutoOrientPage method, PageHeight property, PageWidth property
Topics: | Quick Reference OCR: Working with Pages


UpdateZone method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UpdateZone (short iPageIndex, short iZoneIndex, ILTZoneData * pZone);
Overview | Refer to Working with Zones

Remarks

Updates the zone data of a single zone in the zone list.

See Also

Elements: | ZoneCount property, AddZone method, GetZoneInfo method, RemoveZone method, ImportZones method, ExportZones method, FindZones method, SetAutoZoneOptions method, GetAutoZoneOptions method, DefaultPageFillMethod property, PageFillMethod property, ShowZoneGridLines property, EnableZoneForceSingleColumn property, ZoneHeight property, ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneParser property
Topics: | Quick Reference OCR: Working with Zones


UpdateZoneArea method (ILEADRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UpdateZoneArea (short iPageIndex, short iZoneIndex, float left, float top, float width, float height);
Overview | Refer to Drawing Pages and Zones

Remarks

Updates the specified zone area.

See Also

Elements: | ActivePageIndex property, DrawPage method, DrawPersistence property, SelectedZone property, SelectedZonePenColor property, SelectedZonePenStyle property, UpdatePage method, SetZonePen method, SelectZone method, SelectedZonePenWidth property, SetSelectedZonePen method, SelectZoneByPoint method, RemoveSelectedZone method, EnableShowZones property, ZonePenColor property, ZonePenStyle property, ZonePenWidth property
Topics: | Quick Reference OCR: Drawing Pages and Zones


Bold property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL Bold
Overview | Refer to Using the Character Options

Remarks

Gets or sets a value that indicates whether bold characters will be output as bold.

Setting | Meaning
TRUE | Bold characters are output in bold font.
FALSE | Bold characters are not output in bold font.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

If the OCR engine recognizes a bold character, but the Bold property is set to FALSE, the character will be output as not bold.

See Also

Elements: | FontNames property, SelOutputFont property, Size property, Italic property, Underline property, ResultOptions property, CharacterOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


FontNames property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | FONT_DEFINE FontNames (short iIndex);
Overview | Refer to Using the Character Options

Remarks

Gets or sets an array of values that represent the font names that may be output. For a list of possible values, refer to FONT_DEFINE.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SelOutputFont property, Size property, Bold property, Italic property, Underline property, CharacterOptions property, GetRecognitionResultOptions method, ResultOptions property, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


Italic property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL Italic
Overview | Refer to Using the Character Options

Remarks

Gets or sets a value that indicates whether italic characters that are recognized will be output as italic.

Setting | Meaning
TRUE | The character is italic.
FALSE | The character is not italic.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | FontNames property, SelOutputFont property, Size property, Underline property, Bold property, ResultOptions property, CharacterOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


SelOutputFont property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR SelOutputFont
Overview | Refer to Using the Character Options

Remarks

Gets or sets a value that indicates whether the font names and character sizes are exported, and if so, are they calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current value when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | FontNames property, Size property, Bold property, Italic property, Underline property, ResultOptions property, CharacterOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


Size property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Size
Overview | Refer to Using the Character Options

Remarks

Gets or sets the character size setting for a pre-defined font to be output. This property is used only if the SelOutputFont property is SELPREDEFINED.

Each of the font names in the FontNames property have the same size.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | FontNames property, SelOutputFont property, Bold property, Italic property, Underline property, ResultOptions property, CharacterOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


Underline property (ILTCharacterOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL Underline
Overview | Refer to Using the Character Options

Remarks

Gets or sets a value that indicates whether underlined characters that are recognized will be output underlined.

Setting | Meaning
TRUE | An underlined character is output underlined.
FALSE | An underlined character is output without an underline.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTCharacterOptions properties accessed by the CharacterOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | FontNames property, SelOutputFont property, Size property, Italic property, Bold property, ResultOptions property, CharacterOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Character Options


Color property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OUTPUT_COLOR Color
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates how to output the graphics. For a list of possible values, refer to OUTPUT_COLOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


EnablePageBreaks property

EnablePageBreaks property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnablePageBreaks
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates whether to output page breaks to the final document. Possible values are:

Setting | Meaning
TRUE | Output the page breaks to the final document.
FALSE | Do not output the page breaks to the final document.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


EnableTextInBoxes property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableTextInBoxes
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates whether the contents of the zones will be kept in frames in the final output document. Possible values are:

Setting | Meaning
TRUE | The contents of the zones will be kept in frames in the final output document.
FALSE | The contents of the zones will not be kept in frames in the final output document.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


LanguageMode property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR LanguageMode
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates whether the resulting language is exported, and if so, is the language calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


MarginHeight property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MarginHeight
Overview | Refer to Using the Document Options

Remarks

Gets or sets the height of the output page that contains the recognition results.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


MarginLeft property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MarginLeft
Overview | Refer to Using the Document Options

Remarks

Gets or sets the left coordinate of the page to be exported. This value is exported only if the MarginsMode property is SELPREDEFINED.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


MarginsMode property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR MarginsMode
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates whether the margins will be exported, and if so, whether the margins are calculated or predefined. . For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


MarginTop property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MarginTop
Overview | Refer to Using the Document Options

Remarks

Gets or sets the top coordinate of the page to be exported. This value is exported only if the MarginsMode property is SELPREDEFINED.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


MarginWidth property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MarginWidth
Overview | Refer to Using the Document Options

Remarks

Gets or sets the width of the output page that contains the recognition results.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


PaperOrientation property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | PAPER_ORIENTATION PaperOrientation
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates the orientation of the output document. This value is used only if the PaperSizeMode property is SELPREDEFINED. For a list of possible values, refer to PAPER_ORIENTATIONPAPER_

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


PaperSizeMode property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR PaperSizeMode
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates whether the paper size will be exported and, if the value is exported, it will indicate whether the value is calculated or predefined. For a list of possible values, refer to MODE_SELECTOR

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


PaperType property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | PAPER_TYPE PaperType
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates the type of paper. This value is used only if the PaperSizeMode property is SELPREDEFINED. For a list of possible values, refer to PAPER_TYPE.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


ResultLanguage property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OUTPUT_LANGUAGE ResultLanguage
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that represents the output language. This value is used only if the LanguageMode property is SELPREDEFINED. For a list of possible values, refer to OUTPUT_LANGUAGE.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, TableMethod property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


TableMethod property (ILTDocumentOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | TABLE_METHOD TableMethod
Overview | Refer to Using the Document Options

Remarks

Gets or sets a value that indicates how tables will be output. For a list of possible values,refer to TABLE_METHOD.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the document options for saving the recognition results, set this property and the other ILTDocumentOptions properties accessed by the DocumentOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | PaperSizeMode property, PaperType property, PaperOrientation property, LanguageMode property, ResultLanguage property, Color property, EnableTextInBoxes property, MarginsMode property, MarginLeft property, MarginTop property, MarginWidth property, MarginHeight property, EnablePageBreaks property, DocumentOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Document Options


DLLName property (ILTFileFormatInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR DLLName
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets the character string that contains the name of the output converter DLL file containing the Name converter.

This property is updated with the current value when the GetFileFormatInfo method is called.

The FileFormatInfo property is a pointer to an ILTFileFormatInfo object that accesses properties that are updated with the file format information. This information includes the name of the output text format (FormatName property), the default extension for the document (ExtName property), the type of document to output (Type property) and the name of the converter DLL (DLLName property). These ILTFileFormatInfo properties are read only, so they can only be used to get information about a file format. They cannot be used to change the file format information.

See Also

Elements: | FormatName property, ExtName property, Type property, FileFormatInfo property, GetOutputFileFormats method, GetFileFormatInfo method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


ExtName property (ILTFileFormatInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR ExtName
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets the character string that contains the default extension for the final output document.

This property is updated with the current value when the GetFileFormatInfo method is called.

The FileFormatInfo property is a pointer to an ILTFileFormatInfo object that accesses properties that are updated with the file format information. This information includes the name of the output text format (FormatName property), the default extension for the document (ExtName property), the type of document to output (Type property) and the name of the converter DLL (DLLName property). These ILTFileFormatInfo properties are read only, so they can only be used to get information about a file format. They cannot be used to change the file format information.

See Also

Elements: | FormatName property, Type property, DLLName property, EnumOutputFileFormats event, FileFormatInfo property, GetFileFormatInfo method, GetOutputFileFormats method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


FormatName property (ILTFileFormatInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR FormatName
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets the character string that contains the name of the output text format.

This property is updated with the current value when the GetFileFormatInfo method is called.

The FileFormatInfo property is a pointer to an ILTFileFormatInfo object that accesses properties that are updated with the file format information. This information includes the name of the output text format (FormatName property), the default extension for the document (ExtName property), the type of document to output (Type property) and the name of the converter DLL (DLLName property). These ILTFileFormatInfo properties are read only, so they can only be used to get information about a file format. They cannot be used to change the file format information.

See Also

Elements: | DLLName property, ExtName property, Type property, FileFormatInfo property, GetOutputFileFormats method, GetFileFormatInfo method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


Type property (ILTFileFormatInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | FORMAT_OUTPUT_TYPE Type
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a value that represents the type of document to output (e.g. plain text, word processor, spreadsheet). For a list of possible values, refer to FORMAT_OUTPUT_TYPE.

This property is updated with the current value when the GetFileFormatInfo method is called.

The FileFormatInfo property is a pointer to an ILTFileFormatInfo object that accesses properties that are updated with the file format information. This information includes the name of the output text format (FormatName property), the default extension for the document (ExtName property), the type of document to output (Type property) and the name of the converter DLL (DLLName property). These ILTFileFormatInfo properties are read only, so they can only be used to get information about a file format. They cannot be used to change the file format information.

See Also

Elements: | FormatName property, ExtName property, DLLName property, GetFileFormatInfo method, GetOutputFileFormats method, EnumOutputFileFormats event
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


CharacterHeight property (ILTHandPrintOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CharacterHeight
Overview | Refer to Using the Hand Print Options

Remarks

Sets and gets the character height in 1/1200 of an inch units. A value of zero (0) forces the automatic calculation of this property. If this property is zero (0), the CharacterWidth and CharacterSpace properties will also be 0

This property is updated with the current setting when the GetHandPrintOptions method is called.

To update the hand print options, set this property and the other ILTHandPrintOptions properties accessed by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

See Also

Elements: | Style property, EnableSpace property, CharacterWidth property, CharacterSpace property, GetHandPrintOptions method, SetHandPrintOptions method, HandPrintModuleOptions property
Topics: | Quick Reference OCR: Using the HandPrint Options


CharacterSpace property (ILTHandPrintOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CharacterSpace
Overview | Refer to Using the Hand Print Options

Remarks

Gets or sets the amount of leading space in 1/1200 of an inch increments. A value of zero (0) forces the automatic calculation of this property.

This property is updated with the current setting when the GetHandPrintOptions method is called.

To update the hand print options, set this property and the other ILTHandPrintOptions properties accessed by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

See Also

Elements: | Style property, EnableSpace property, CharacterHeight property, CharacterWidth property, GetHandPrintOptions method, SetHandPrintOptions method, HandPrintModuleOptions property
Topics: | Quick Reference OCR: Using the HandPrint Options


CharacterWidth property (ILTHandPrintOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CharacterWidth
Overview | Refer to Using the Hand Print Options

Remarks

Gets or sets the character width in 1/1200 of an inch increments. A value of zero (0) forces the automatic calculation of this property.

This property is updated with the current setting when the GetHandPrintOptions method is called.

To update the hand print options, set this property and the other ILTHandPrintOptions properties accessed by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

See Also

Elements: | Style property, EnableSpace property, CharacterHeight property, CharacterSpace property, GetHandPrintOptions method, SetHandPrintOptions method, HandPrintModuleOptions property
Topics: | Quick Reference OCR: Using the HandPrint Options


EnableSpace property (ILTHandPrintOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableSpace
Overview | Refer to Using the Hand Print Options

Remarks

Gets or sets a value that indicates whether the hand printed numeral recognition module exports spaces detected between characters. Possible values are:

Setting | Meaning
TRUE | Export spaces detected between characters.
FALSE | Do not export spaces detected between characters.

This property is updated with the current setting when the GetHandPrintOptions method is called.

To update the hand print options, set this property and the other ILTHandPrintOptions properties accessed by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

See Also

Elements: | Style property, CharacterHeight property, CharacterWidth property, CharacterSpace property, HandPrintModuleOptions property, GetHandPrintOptions method, SetHandPrintOptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


Style property (ILTHandPrintOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | HAND_STYLE Style
Overview | Refer to Using the Hand Print Options

Remarks

Gets or sets a value that indicates the writing style for hand printed numerals. For a list of possible values, refer to HAND_STYLE.

This property is updated with the current setting when the GetHandPrintOptions method is called.

To update the hand print options, set this property and the other ILTHandPrintOptions properties accessed by the HandPrintModuleOptions property and call the SetHandPrintOptions method.

See Also

Elements: | EnableSpace property, CharacterHeight property, CharacterWidth property, CharacterSpace property, GetHandPrintOptions method, SetHandPrintOptions method, HandPrintModuleOptions property
Topics: | Quick Reference OCR: Using the HandPrint Options


ColMissingSymbol property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColMissingSymbol
Overview | Refer to Using the Mark Options

Remarks

Gets or sets a value that represents the color used to output the missing symbol. Valid values may be one or more OUTPUT_COLOR values, ORed (|).

The character used to replace missing characters in both the recognition process and when saving the recognition results is contained in the SpecialMissingSymbol property.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, ColRejectionSymbol property, SeparatorBeforeSuspectCharacter property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


ColorSuspectCharacter property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColorSuspectCharacter
Overview | Refer to Using the Mark Options

Remarks

Gets or sets a value that represents the color used to output suspect characters. Valid values may be one or more OUTPUT_COLOR values, ORed (|).

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColRejectionSymbol property, ColMissingSymbol property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


ColRejectionSymbol property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColRejectionSymbol
Overview | Refer to Using the Mark Options

Remarks

Gets or sets a value that represents the color used to output rejected characters. Valid values may be one or more OUTPUT_COLOR values, ORed (|).

The character used to replace rejected characters in both the recognition process and when saving the recognition results is contained in the SpecialRejectedCharacter property.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter, ColMissingSymbol property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


ColSuspectWord property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColSuspectWord
Overview | Refer to Using the Mark Options

Remarks

Gets or sets a value that represents the color used to output suspect words. Suspect words are words not approved by the checking subsystem. Valid values may be one or more OUTPUT_COLOR values, ORed (|).

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeSuspectCharacter property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorBeforeMissingSymbol property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorBeforeMissingSymbol
Overview | Refer to Using the Mark Options

Remarks

Sets and Gets the string that will be inserted before each missing symbol in the final output document.

Gets or sets the string that will be output before each missing character.

The character used to replace missing characters in both the recognition process and when saving the recognition results is contained in the SpecialMissingSymbol property.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorBeforeRejectionSymbol property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorBeforeRejectionSymbol
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output before each rejected character.

The character used to replace rejected characters in both the recognition process and when saving the recognition results is contained in the SpecialRejectedCharacter property.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorBeforeSuspectCharacter property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorBeforeSuspectCharacter
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output before each suspect character.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property , ColRejectionSymbol property , ColMissingSymbol property , SeparatorBeforeRejectionSymbol property , SeparatorBeforeMissingSymbo property l, SeparatorStartSuspectWord property , SeparatorEndSuspectWord property . SeparatorStartLine property . SeparatorEndLine property , SeparatorStartTableRow property , SeparatorEndTableRow property , SeparatorStartParagraph property , SeparatorEndParagraph property , SeparatorStartZone property , SeparatorEndZone property , SeparatorStartPage property , SeparatorEndPage property , MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndLine property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndLine
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the end of each line.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndPage property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndPage
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the end of each page.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndParagraph property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndParagraph
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the end of each paragraph.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndSuspectWord property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndSuspectWord
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output after each suspect word. A suspect word is one that is not approved by the checking subsystem.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndTableRow property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndTableRow
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the end of each table row.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorEndZone property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorEndZone
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the end of each zone.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartLine property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartLine
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the beginning of each line.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartPage property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartPage
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the beginning of each page.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartParagraph property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartParagraph
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the beginning of each paragraph.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorEndParagraph property, SeparatorStartZone, SeparatorEndZone property, SeparatorStartPage, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartSuspectWord property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartSuspectWord
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output before each suspect word. A suspect word is one that is not approved by the checking subsystem.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorEndSuspectWord property. SeparatorStartLine property. SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartTableRow property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartTableRow
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output before each table row.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorStartZone property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


SeparatorStartZone property (ILTMarkOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SeparatorStartZone
Overview | Refer to Using the Mark Options

Remarks

Gets or sets the string that will be output at the beginning of each zone.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the mark options for saving the recognition results, set this property and the other ILTMarkOptions properties accessed by the MarkOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | ColorSuspectCharacter property, ColSuspectWord property, SeparatorBeforeSuspectCharacter property, ColMissingSymbol property, ColRejectionSymbol property, SeparatorBeforeRejectionSymbol property, SeparatorBeforeMissingSymbol property, SeparatorStartSuspectWord property, SeparatorEndSuspectWord property. SeparatorStartLine property, SeparatorEndLine property, SeparatorStartTableRow property, SeparatorEndTableRow property, SeparatorStartParagraph property, SeparatorEndParagraph property, SeparatorEndZone property, SeparatorStartPage property, SeparatorEndPage property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Mark Options


EnableFill property (ILTOMROptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableFill
Overview | Refer to Using the OMR Options

Remarks

Gets or sets a value that indicates whether the recognition output can take two or three values. Possible values are:

Value | Meaning
TRUE | Three values are possible for grouped zones: 0 = unfilled, 1 = filled, 2 = filled-in-error.
FALSE | Only one of two values can be generated for each RM_OMR zone: 0 = unfilled 1 = filled

This property is updated with the current setting when the GetOMROptions method is called.

To update the OMR options, set this property and the other ILTOMROptions properties accessed by the OMRModuleOptions property and call the SetOMROptions method.

See Also

Elements: | Frame property, Sense property, OMRModuleOptions property, GetOMROptions method, SetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


Frame property (ILTOMROptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OMR_FRAME Frame
Overview | Refer to Using the OMR Options

Remarks

Gets or sets a value that indicates whether the OMR zone borders will be visible or invisible in the images. For a list of possible values, refer to OMR_FRAME

This property is updated with the current setting when the GetOMROptions method is called.

To update the OMR options, set this property and the other ILTOMROptions properties accessed by the OMRModuleOptions property and call the SetOMROptions method.

See Also

Elements: | EnableFill property, Sense property, OMRModuleOptions property, GetOMROptions method, SetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


Sense property (ILTOMROptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OMR_SENSE Sense
Overview | Refer to Using the OMR Options

Remarks

Gets or sets a value that indicates the mark sensitivity level. For a list of possible values, refer to OMR_SENSE

The default value is OMRSENSE_NORMAL.

This property is updated with the current setting when the GetOMROptions method is called.

To update the OMR options, set this property and the other ILTOMROptions properties accessed by the OMRModuleOptions property and call the SetOMROptions method.

See Also

Elements: | EnableFill property, Frame property, OMRModuleOptions property, GetOMROptions method, SetOMROptions method
Topics: | Quick Reference OCR: Using the HandPrint Options


AlignmentMode property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR AlignmentMode
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that indicates whether the alignment will be exported, and if so, is the alignment calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, SpaceBefore property, ParagraphIndentMode property, FirstLineIndent property, LineSpacingMode property, LineSpacing property property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


Alignment property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | ALIGNMENT_TYPE Alignment
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that represents the alignment to be exported. This value is used only if the AlignmentMode property is SELPREDEFINED. For a list of possible values, refer to ALIGNMENT_TYPE.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, SpaceBefore property, ParagraphIndentMode property, FirstLineIndent property, LineSpacingMode property, LineSpacing property, AlignmentMode property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


FirstLineIndent property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FirstLineIndent
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that represents the length of the indentation of the first line of paragraph, that will be exported. This value is measured in Twips, and it is used only if the ParagraphIndentMode property is SELPREDEFINED.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, ParagraphIndentMode property, LineSpacingMode property, LineSpacing property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


LineSpacing property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | LINE_SPACING LineSpacing
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that represents the line spacing to be exported. This value is used only if the LineSpacingMode property is SELPREDEFINED. For a list of possible values, refer to LINE_SPACING.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, SpaceBefore property, ParagraphIndentMode property property, FirstLineIndent property, LineSpacingMode property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


LineSpacingMode property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR LineSpacingMode
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that indicates whether the line spacing is exported, and if so, is it calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, SpaceBefore property, ParagraphIndentMode property, FirstLineIndent property, LineSpacing property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


ParagraphIndentMode property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR ParagraphIndentMode
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that indicates whether an indented first line of a paragraph will be exported, and if so, is the indentation size calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, SpaceBefore property, FirstLineIndent property, LineSpacingMode property, LineSpacing property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


SpaceBefore property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SpaceBefore
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that represents the number of spaces before a paragraph that are exported. This value is used only if the SpaceBeforeMode property is SELPREDEFINED. This value is measured in Twips.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBeforeMode property, ParagraphIndentMode property, FirstLineIndent property, LineSpacingMode property, LineSpacing property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


SpaceBeforeMode property (ILTParagraphOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | MODE_SELECTOR SpaceBeforeMode
Overview | Refer to Using the Paragraph Options

Remarks

Gets or sets a value that indicates whether the extra space before a paragraph is exported, and if so, is it calculated or predefined. For a list of possible values, refer to MODE_SELECTOR.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

To update the paragraph options for saving the recognition results, set this property and the other ILTParagraphOptions properties accessed by the ParagraphOptions property of the ResultOptions property, and call the SetRecognitionResultOptions method.

See Also

Elements: | SpaceBefore property, ParagraphIndentMode property, FirstLineIndent property, LineSpacingMode property, LineSpacing property, AlignmentMode property, Alignment property, ResultOptions property, ParagraphOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Using the Paragraph Options


EnumOutputFileFormats event (ILTRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | void EnumOutputFileFormats(FORMATTYPE Format)
Overview | Refer to Handling the Results of the Recognition Process

Remarks

This event is generated for each file format enumerated by the GetOutputFileFormats method. For each file format enumerated, call the GetFileFormatInfo method to update the FileFormatInfo property with information on that file format.

See Also

Elements: | GetOutputFileFormats method, GetFileFormatInfo method, FileFormatInfo property, DLLName property, ExtName property, Typeproperty, FormatName property
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


ProgressStatus event (ILTRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ProgressStatus(OCR_PROCESS_ID ID, short iPercent, short iAcceptCharCount, short iRejectCharCount, long lObjSize, BSTR bstrObjData)
Overview | Refer to Starting and Shutting Down the Engine

Remarks

This event is generated by OCR methods to report the progress of a specific operation and offer the client an opportunity to cancel.

To activate this event, set the EnableProgressStatusEvent property value to TRUE.

To stop receiving this event set the StopProgressStatusEvent property value to TRUE.

See Also

Elements: | EnableProgressStatusEvent property, StopProgressStatusEvent property
Topics: |


RecognitionStatus event (ILTRasterDocument)

Visual Basic example

Visual C++ 5.0 example

Syntax | void RecognitionStatus(short iRecog, short iError)
Overview | Refer to Recognizing Document Pages

Remarks

This event is generated after each page is recognized, if the event has been activated.

To activate this event, set the EnableFireRecognizeStatus property value to TRUE.

To stop receiving this event the EnableStopRecognizeStatus property value to TRUE.

See Also

Elements: | EnableStopRecognizeStatus property, EnableFireRecognizeStatus property
Topics: | Quick Reference OCR: Recognizing Document Pages


CellIndex property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CellIndex
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the index of the cell that contains the recognized character. This is applicable only for ZONE_TABLE zones.

The list of cells is not accessible by the application.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, YOffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Confidence property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Confidence
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a value that represents the certainty of the recognition of the first guess and the certainty of the word.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Flags property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a value that indicates whether a character is the end of a line, word, zone, etc. For a list of possible values, refer to CHARFLAGS.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Font property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Font
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a value that represents the font of the recognized character. For a list of possible values, refer to FONTFLAGS.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


FontSize property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FontSize
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the font size, in points, of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


GuessCode property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR GuessCode
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a UNICODE string that contains the engine's first guess for a character, or a zero (0) indicating the character was not recognized and was rejected.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


GuessCode2 property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR GuessCode2
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a UNICODE string that contains the engine's second guess for a character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


GuessCode3 property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR GuessCode3
Overview | Refer to Using Recognized Characters

Remarks

Sets and Gets the third guess of the recognition.

Gets or sets a UNICODE string that contains the engine's third guess for a character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Height property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Height
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the height of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Width property, Left property, Yoffset property, Space property, SpaceErr property, GuessCode, GuessCode2 property, GuessCode3 property, ZoneIndex, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


LanguageId property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS LanguageId
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a value that represents the first language in which the recognized word is found. For a list of possible values, refer to LANG_IDS.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


LanguageId2 property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | LANG_IDS LanguageId2
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a value that represents the second language in which the recognized word is found. For a list of possible values, refer to LANG_IDS.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Left property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Left
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the left coordinate of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode, GuessCode2 property, GuessCode3 property, ZoneIndex, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Space property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Space
Overview | Refer to Using Recognized Characters

Remarks

Get or sets the value that represents the number of spaces in front of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


SpaceErr property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SpaceErr
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets a confidence number expressing the certainty or reliability of the value in the Space property.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, GuessCode property, GuessCode2 property, GuessCode3 property, ZoneIndex property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Top property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Top
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the top coordinate of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode, GuessCode2 property, GuessCode3 property, ZoneIndex, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


Width property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Width
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the width of the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Left property, Top property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode, GuessCode2 property, GuessCode3 property, ZoneIndex, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


YOffset property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | long YOffset
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the Y offset of the baseline measured from the top edge of the bounding rectangle of the character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Width property, Left property, Height property, Space property, SpaceErr property, GuessCode, GuessCode2 property, GuessCode3 property, ZoneIndex, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


ZoneIndex property (ILTRecognizedCharacters)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ZoneIndex
Overview | Refer to Using Recognized Characters

Remarks

Gets or sets the index of the zone that contains the recognized character.

This property is updated with the current setting when the GetRecognizedCharacters method is called.

To update the set of recognized characters, set this property and the other ILTRecognizedCharacters properties accessed by the RecognizedCharacter property and call the SetRecognizedCharacters method.

See Also

Elements: | Top property, Left property, Width property, Height property, Yoffset property, Space property, SpaceErr property, GuessCode property, GuessCode2 property, GuessCode3 property, CellIndex property, Confidence property, Font property, Flags property, FontSize property, LanguageId property, LanguageId2 property, GetRecognizedCharacters method, RecognizedCharactersCount property, RecognizedCharacter property, SetRecognizedCharacters method
Topics: | Quick Reference OCR: Using Recognized Characters


DecompositionTime property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | long DecompositionTime
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the amount of time the engine spent on the document's page-layout decomposition/ automatic zoning. (This is the PID_DECOMPOSITION process.) This value is measured in 1/1000 of a second increments.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property property, PreProcessTime property, and the ReadingTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


PreProcessTime property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PreProcessTime
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the amount of time the engine spent on image pre-processing. This value is measured in 1/1000 of a second increments.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, DecompositionTime property, and the ReadingTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


ReadingTime property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ReadingTime
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the amount of time the engine spent on the document, from the start of the recognition process until the recognition results were written. It consists of the time specified in the RecognizedTime property, the time necessary for sorting the output coming from the different recognition modules, the time spent with the checking subsystem, and the time required to write the recognition result.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


RecognizedCharacterCount property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RecognizedCharacterCount
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the number of recognized characters obtained by the GetStatus. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


RecognizedTime property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RecognizedTime
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the amount of time the engine time spent recognizing the document content. This is the pure recognition time that the document spent in the different recognition modules involved in the recognition process. This value is measured in 1/1000 of a second increments.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, ReadingTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RejectWordCount property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


RecognizedWordCount property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RecognizedWordCount
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the number of recognized words in the document.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedCharacterCount property, RejectCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


RejectCharacterCount property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RejectCharacterCount
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the number of rejected characters in the document.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectWordCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


RejectWordCount property (ILTRecognizeStatus)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RejectWordCount
Overview | Refer to Getting Status Updates

Remarks

(Read only) Gets the number of words rejected by the checking subsystem.

This property is updated with the current value when the GetStatus method is called. It is accessed through the RecognizeStatus property.

The RecognizeStatus property is a pointer to an ILTRecognizeStatus object that accesses properties that are updated with the status information. This information includes the RecognizedWordCount property, RecognizedCharacterCount property, RejectCharacterCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, and the DecompositionTime property.

See Also

Elements: | RecognizedCharacterCount property, RecognizedWordCount property, RejectCharacterCount property, RecognizedTime property, ReadingTime property, PreProcessTime property, DecompositionTime property, RecognizeStatus property, GetStatus method, Recognize method
Topics: | Quick Reference OCR: Getting Status Updates


CharacterOptions property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTCharacterOptions * CharacterOptions
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a pointer to an ILTCharacterOptions object that contains character options used by the OCR engine when saving recognition results.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

The CharacterOptions property itself is read only. However, the properties accessed by this property, through the ResultOptions property, can be set with new character option values and these values set for the OCR engine by calling the SetRecognitionResultOptions method.

See Also

Elements: | Format property, FormatLevel property, DocumentOptions property, ParagraphOptions property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: |


DocumentOptions property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTDocumentOptions * DocumentOptions
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a pointer to an ILTDocumentOptions object that contains document options used by the OCR engine when saving recognition results.

This property is updated with the current values when the GetRecognitionResultOptions method is called.

The DocumentOptions property itself is read only. However, the properties accessed by this property, through the ResultOptions property, can be set with new document option values and these values set for the OCR engine by calling the SetRecognitionResultOptions method.

See Also

Elements: | Format property, FormatLevel property, ParagraphOptions property, CharacterOptions property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: |


Format property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | FORMATTYPE Format
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Gets or sets the format type of the output document in which the recognition results are saved. For a list of possible values, refer to FORMATTYPE.

This property is updated with the current setting when the GetRecognitionResultOptions method is called.

To update the recognition result options, set this property and the other ILTResultOptions properties accessed by the ResultOptions property and call the SetRecognitionResultOptions method.

See Also

Elements: | FormatLevel property, DocumentOptions property, ParagraphOptions property, CharacterOptions property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


FormatLevel property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | FORMAT_LEVEL FormatLevel
Overview | Refer to Handling the Results of the Recognition Process

Remarks

Gets or sets a value that represents the amount of formatting that is exported to the output document in which the recognition results are saved. For a list of possible values, refer to FORMAT_LEVEL.

This property is updated with the current setting when the GetRecognitionResultOptions method is called.

To update the recognition result options, set this property and the other ILTResultOptions properties accessed by the ResultOptions property and call the SetRecognitionResultOptions method.

See Also

Elements: | Format property, DocumentOptions property, ParagraphOptions property, CharacterOptions property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: | Quick Reference OCR: Handling the Results of the Recognition Process


MarkOptions property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTMarkOptions * MarkOptions
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read only) Gets a pointer to an ILTMarkOptions object that contains mark options used by the OCR engine when saving recognition results..

This property is updated with the current values when the GetRecognitionResultOptions method is called.

The MarkOptions property itself is read only. However, the properties accessed by this property, through the ResultOptions property, can be set with new paragraph option values and these values set for the OCR engine by calling the SetRecognitionResultOptions method.

See Also

Elements: | Format property, FormatLevel property, DocumentOptions property, ParagraphOptions property, CharacterOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: |


ParagraphOptions property (ILTResultOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTParagraphOptions * ParagraphOptions
Overview | Refer to Handling the Results of the Recognition Process

Remarks

(Read Only) Gets a pointer to an ILTParagraphOptions object that contains paragraph options used by the OCR engine when saving recognition results..

This property is updated with the current values when the GetRecognitionResultOptions method is called.

The ParagraphOptions property itself is read only. However, the properties accessed by this property, through the ResultOptions property, can be set with new paragraph option values and these values set for the OCR engine by calling the SetRecognitionResultOptions method.

See Also

Elements: | Format property, FormatLevel property, DocumentOptions property, CharacterOptions property, MarkOptions property, ResultOptions property, GetRecognitionResultOptions method, SetRecognitionResultOptions method
Topics: |


Bottom property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Bottom
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets the bottom boundary of the zone, in pixels.

The following properties are also used to define the area of the zone:

Left property

Right property

Top property

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Left property, ID property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


CharacterFilter property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | CHARFILTER CharacterFilter
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that represents the character set filter for the zone. For a list of possible values, refer to CHARFILTER.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


EnableVerificationEvent property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableVerificationEvent
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that indicates whether the Verification event is generated. Possible values are:

Setting | Meaning
TRUE | The Verification event is/will be generated.
FALSE | The Verification event is not/will not be generated.

The StopVerificationEvent property is designed to be set within the Verification event itself, to stop the current event. The EnableVerificationEvent property is designed to be set outside the Verification event to control whether the event is generated.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


FillMethod property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | FILL_METHOD FillMethod
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that represents the filling method for the zone. For a list of possible values, refer to FILL_METHOD.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Left property, Bottom property, ID property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Flags property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets flags that control the checking process. For a list of possible values, refer to ZONEFLAGS. These flags can be combined using OR (|).

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


ID property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ID
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets the identifier of the zone. This property is mainly managed by the engine.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Left property, Bottom property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Left property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Left
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets the left boundary of the zone, in pixels.

The following properties are also used to define the area of the zone:

Right property

Top property

Bottom property

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


RecognizeModule property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | RECOGNIZE_MODULE RecognizeModule
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that represents the recognition module associated with the zone. For a list of possible values, refer to RECOGNIZE_MODULE.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Right property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Right
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets the right boundary of the zone, in pixels.

The following properties are also used to define the area of the zone:

Left property

Top property

Bottom property

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Left property, Bottom property, ID property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


SectionName property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR SectionName
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a string that contains a section name. This is a NULL terminated string.

The section name may be the section name in the User dictionary assigned to the zone, or it may be an empty string.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


StopVerificationEvent property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL StopVerificationEvent
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that indicates whether to stop generating the Verification event. Possible values are:

Setting | Meaning
TRUE | Stop generating the Verification event.
FALSE | Continnue generating the Verification event.

The StopVerificationEvent property is designed to be set within the Verification event itself, to stop the current event. The EnableVerificationEvent property is designed to be set outside the Verification event to control whether the event is generated.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Top property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Top
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets the top boundary of the zone, in pixels.

The following properties are also used to define the area of the zone:

Left property

Right property

Bottom property

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Left property, Right property, Bottom property, ID property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Type property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | ZONE_TYPE Type
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that represents the zone type. For a list of possible values, refer to ZONE_TYPE.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Flags property, SectionName property, EnableVerificationEvent property,StopVerificationEvent property, VerifyCode property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Verification event (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | void Verification(short iZoneIndex, BSTR bstrWord)
Overview | Refer to Using the ILTZoneData Properties

Remarks

This event is generated to report the suggested word for the last recognized word in a specific zone.

To activate this event, set the EnableVerificationEvent property to TRUE.

To stop receiving this event the StopVerificationEvent property value to TRUE.

See Also

Elements: | EnableVerificationEvent property, StopVerificationEvent property
Topics: |


VerifyCode property (ILTZoneData)

Visual Basic example

Visual C++ 5.0 example

Syntax | VERIFY_CODE VerifyCode
Overview | Refer to Using the ILTZoneData Properties

Remarks

Gets or sets a value that indicates whether the recognized word is acceptable. For a list of possible values, refer to VERIFY_CODE.

This property should be set within the Verification event.

If this property is VF_ACCEPT, the engine accepts the recognized word and proceeds to the next recognized word for verification. If this property is not VF_ACCEPT, the engine does not accept the recognized word and offers suggestions for the recognized word.

For more information on the other properties used to define a zone, refer to ILTZoneData.

See Also

Elements: | Top property, Right property, Bottom property, ID property, Left property, FillMethod property, RecognizeModule property, CharacterFilter property, Type property, Flags property, SectionName property, EnableVerificationEvent property, StopVerificationEvent property, Verification event
Topics: | Quick Reference OCR: Using the ILTZoneData Properties


Syntax

This is the internal syntax of the property, method, or event. The external syntax depends on the development system you are using. Refer to the code example for your system, or for general information, refer to the following:

Visual Basic Syntax

Visual C++ 5.0 Syntax


Visual C++ Key Codes

The following are the Visual C++ key codes:

VK_A through VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'.
VK_0 through VK_9 are the same as their ASCII equivalents: '0' thru '9'.
VK_LBUTTON
VK_RBUTTON
VK_CANCEL
VK_MBUTTON
VK_BACK
VK_TAB
VK_CLEAR
VK_RETURN
VK_SHIFT
VK_CONTROL
VK_MENU
VK_PAUSE
VK_CAPITAL
VK_ESCAPE
VK_SPACE
VK_PRIOR
VK_NEXT
VK_END
VK_HOME
VK_LEFT
VK_UP
VK_RIGHT
VK_DOWN
VK_SELECT
VK_PRINT
VK_EXECUTE
VK_SNAPSHOT
VK_INSERT
VK_DELETE
VK_HELP

VK_NUMPAD0
VK_NUMPAD1
VK_NUMPAD2
VK_NUMPAD3
VK_NUMPAD4
VK_NUMPAD5
VK_NUMPAD6
VK_NUMPAD7
VK_NUMPAD8
VK_NUMPAD9
VK_MULTIPLY
VK_ADD
VK_SEPARATOR
VK_SUBTRACT
VK_DECIMAL
VK_DIVIDE
VK_F1
VK_F2
VK_F3
VK_F4
VK_F5
VK_F6
VK_F7
VK_F8
VK_F9
VK_F10
VK_F11
VK_F12
VK_F13
VK_F14
VK_F15
VK_F16
VK_F17
VK_F18
VK_F19
VK_F20
VK_F21
VK_F22
VK_F23
VK_F24
VK_NUMLOCK
VK_SCROLL


Visual Basic Constants for Key Codes

Do the following to find the Visual Basic key codes:

1. | On the View pull-down menu, select Object Browser....
2. | Select VB - Visual Basic objects and procedures.
3. | Select VBKeyCodeConstants.
4. | Select one of the listed constants.

A description of the constant appears at the bottom of the form.


Visual Basic Only

LEADTOOLS methods that reference picture objects were developed for Visual Basic. Picture objects in other development systems have not worked in tests and do not appear to be compatible.


LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling UnlockSupport (L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling LSettings::UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the .

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements.


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

Congratulations! You have licensed one of the LEADTOOLS Document/Medical software products, the most comprehensive imaging toolkits on the market, enabling you to create powerful imaging applications. The license terms for LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite require runtime licensing based on the number of copies of your application that you deploy (i.e., distribute or install and use internally).

By paying the initial box price for the applicable LEADTOOLS product, you have obtained a development license, which entitles you to develop your application and test it. Once completed, if you wish to distribute the application or deploy it internally on multiple machines, you are required to enter into a duplication and distribution agreement with LEAD. You have the ability to choose from several licensing options depending on your volume needs.

The product you are installing is a fully functional working version and includes support for all features in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. (Depending on which product you have licensed, some of the features may ultimately not be available to you. See the on-line help file for a product feature comparison.) Until you sign and return the correct licensing agreement, your application will display a "nag" message. Once LEAD receives the executed contract, we will provide you a password that will permit you to terminate the "nag" message for the product that you have licensed. In addition to providing the password, you must also use the no nag version of the LTKRN14N.DLL, found in the REDIST\NONAGLTKRN directory. This is also the version you must redistribute.

Duplication and Distribution Agreements

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.


Topic Selection

LEAD Technologies, Inc.
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

CompuServe: 71333,2237 or GO LEADTECH

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.


iIndex Parameter For ActiveLanguage

iIndex

Index into the array of active language IDs.


bstrSection Parameter For AddItemToUserDictionary

bstrSection

String that contains the name of the section in which to add the item. If the specified section does not exist, a new section will be created automatically.


bstrUIDitem Parameter For AddItemToUserDictionary

bstrUIDitem

String containing the item to be added.


Return for AddItemToUserDictionary

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For AddPage

iPageIndex

Position in the list of pages at which to insert the new page. Use -1 to append the page to the end of the list. This is a zero-based index. For example, if there are 10 pages in the list, the index of the last page is 9. If you insert a page within the list, the indices of other pages will change automatically to accommodate the insertion.


pRaster Parameter For AddPage

pRaster

Pointer to the raster object that references the new page to be inserted into the internal list of pages that make up the OCR document.


Return for AddPage

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


iPageIndex Parameter For AddZone

iPageIndex

Index of the page on which to add the zone. This is a zero-based index.


iZoneIndex Parameter For AddZone

iZoneIndex

Position in the list of zones at which to add new zone. Use -1 to append the zone to the end of the list. This is a zero-based index.


pZone Parameter For AddZone

pZone

Pointer to an ILTZoneData object, which contains the zone data to be added.


Return for AddZone

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


iPageIndex Parameter For AutoOrientPage

iPageIndex

Index of the page to auto orient. This is a zero-based index.


Return for AutoOrientPage

Return Value

Return | Meaning
0 | The method call was successful.
<>0 | An error occurred, refer to Error Codes.


iPageIndex Parameter For DefaultPageFillMethod

iPageIndex

Index into the internal list of pages. This is a zero-based index.


iIndex Parameter For DefaultSpellLanguages

iIndex

Index into the array of language Ids. This is a zero-based index.


iPageIndex Parameter For DetectOrientationDegree

iPageIndex

Index of the page for which to get the angle of orientation. This is a zero-based index.


hDC Parameter For DrawPage

hDC

Handle to a device context, such as a screen, to use as the display surface.


iPageIndex Parameter For DrawPage

iPageIndex

Specifies the index of the page that will be drawn. This index is zero-based.


pRaster Parameter For DrawPage

pRaster

Pointer to the raster object that references the OCR document.


Return for DrawPage

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Format Parameter for EnumOutputFileFormats

Format

Specifies the output format that is available in the OCR document engine. For a list of possible values, refer to FORMATTYPE.


iPageIndex Parameter For ExportPage

iPageIndex

Index of the page to export. This is a zero-based index


pRaster Parameter For ExportPage

pRaster

Pointer to the raster object to be updated with the exported page.


Return for ExportPage

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes


bstrFileName Parameter For ExportZones

bstrFileName

Character string that contains the name of the zone file. This string should include the file extension.


iPageIndex Parameter For ExportZones

iPageIndex

Specifies the index of the page from which to export the zones. This is a zero-based index.


Return for ExportZones

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bUseImageArea Parameter For FindZones

bUseImageArea

Flags that specify the area of the page to search for zones.

Setting | Description
TRUE | Search the entire page for zones.
FALSE | Search only the area specified by the ZoneLeft property, ZoneTop property, ZoneWidth property, ZoneHeight property


iPageIndex Parameter For FindZones

iPageIndex

Specifies the index of the page to search. This is a zero-based index.


Return for FindZones

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes..


iIndex Parameter For FontNames

iIndex

Index into the array of Font IDs.


Return for GetAutoZoneOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes ErrorCodes.


Format Parameter For GetFileFormatInfo

Format

Specifies the format type for which to get information


Return for GetFileFormatInfo

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for GetHandPrintOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for GetOMROptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes


Return for GetOutputFileFormats

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for GetRecognitionResultOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For GetRecognizedCharacters

iPageIndex

Specifies the index of the recognized page for which to get the recognized characters. This is a zero-based index


Return for GetRecognizedCharacters

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter for GetRecognizedWords

iPageIndex

Index of the recognized page from which to get the recognized words. This index is zero-based.


Return for GetRecognizedWords

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for GetStatus

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bFirst Parameter For GetUserDictionarySection

bFirst

Specifies to get the first section or not, valid values:

Value | Meaning
TRUE | Gets the first section in the user dictionary.
FALSE | Gets the next section in the user dictionary


Return for GetUserDictionarySection

Return Value

Returns a Null terminated string that contains the section name.


bFirst Parameter For GetUserDictionarySectionItem

bFirst

Flag that indicates whether to get the name of the first section item or the next section item. Possible values are:

Value | Meaning
TRUE | Get the first section item in the specified section.
FALSE | Get the next section item in the specified section.


Return for GetUserDictionarySectionItem

Return Value

String that contains the section item name.


bstrSection Parameter For GetUserDictionarySectionItem

bstrSection

String that contains the name of the section of the user dictionary for which to list the items.


lSize Parameter For GetUserDictionarySectionItem

lSize

Specifies the size, in bytes, of the buffer, returned by this method, that contains the section item.


lSize Parameter For GetUserDictionarySection

lSize

Specifies the size, in bytes, of the buffer returned by this method.


iPageIndex Parameter For GetZoneInfo

iPageIndex

Specifies the index of the page from which to get the zone information. This is a zero-based index.


iZoneIndex Parameter For GetZoneInfo

iZoneIndex

Specifies the index of the zone for which to get the information. This is a zero-based index.


pZone Parameter For GetZoneInfo

pZone

Pointer to an ILTZoneData object the method updates with zone information.


Return for GetZoneInfo

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bstrFileName Parameter For ImportZones

bstrFileName

Character string containing the name of the zone file that contains the zones to import. This must include the extension.


iPageIndex Parameter For ImportZones

iPageIndex

Specifies the index of the page into which the zones will be imported. This is a zero-based index.


Return for ImportZones

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for IsCharacterEnabled

Return Value

Return | Meaning
TRUE | The specified character is enabled in the OCR engine.
FALSE | The specified character is not enabled in the OCR engine.


ch Parameter For IsCharacterEnabled

ch

Character to be checked in the OCR document engine.


bstrFileName Parameter For LoadSettingsFile

bstrFileName

String that contains the name of the OCR engine settings file to load.


Return for LoadSettingsFile

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for OffsetZones

Return Value

None.


x Parameter For OffsetZones

x

Value that represents the amount of horizontal scrolling.


y Parameter For OffsetZones

y

Value that represents the amount of vertical scrolling.


iPageIndex Parameter For PageBitsPerPixel

iPageIndex

Specifies the index of the page for which to get the bits per pixel. This is a zero-based index.


iPageIndex Parameter For PageHeight

iPageIndex

Specifies the index of the page for which to get the height. This is a zero-based index


iPageIndex Parameter For PageWidth

iPageIndex

Specifies the index of the page for which to get the width. This is a zero-based index


iPageIndex Parameter For PaintZoomFactor

iPageIndex

Index of the page for which to get or set the zoom factor. This index is zero-based.


bstrObjData Parameter for ProgressStatus

bstrObjData

Sample text from the recognized characters (typically 30-80 chars) in UNICODE for real-time information


iAcceptCharCount Parameter for ProgressStatus

iAcceptCharCount

Number of characters recognized during the recognition process


ID Parameter for ProgressStatus

ID

Identifier of the process currently running.


iPercent Parameter for ProgressStatus

iPercent

Progress of the current process expressed as a percentage


iRejectCharCount Parameter for ProgressStatus

iRejectCharCount

Number of characters rejected during the recognition process


lObjSize Parameter for ProgressStatus

lObjSize

Size of the bstrObjData buffer containing the real time information


iError Parameter for RecognitionStatus

iError

Specifies the error that will be returned from the recognition process. For a list of values refer to the Error Codes.


iRecog Parameter for RecognitionStatus

iRecog

Specifies the index for the recognized page. This index is zero-based.


iIndex Parameter For RecognizedCharacter

iIndex

Specifies the index of the page for which to get the recognized characters. This is a zero-based index.


iIndex Parameter For RecognizedWordHeight

iIndex

Index into the array of word height values. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iIndex Parameter For RecognizedWord

iIndex

Index into the array of recognized words. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iIndex Parameter For RecognizedWordLeft

iIndex

Index into the array of word left coordinate values. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iIndex Parameter For RecognizedWordTop

iIndex

Index into the array of word top coordinate values. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iIndex Parameter For RecognizedWordWidth

iIndex

Index into the array of word width values. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iIndex Parameter For RecognizedWordZone

iIndex

Index into the array of zone values. This is a zero-based index. Possible values range from 0 to RecognizedWordsCount property – 1.


iPageCount Parameter For Recognize

iPageCount

The total number of pages to be recognized.


iStartPage Parameter For Recognize

iStartPage

The index of the first page to be recognized. This is a zero-based index


Return for Recognize

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes..


bstrSection Parameter For RemoveItemFromUserDictionary

bstrSection

String that contains the name of the section from which to remove the item.


bstrUDitem Parameter For RemoveItemFromUserDictionary

bstrUDitem

String containing the item to be deleted. The string must be terminated with a double zero.


Return for RemoveItemFromUserDictionary

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For RemovePage

iPageIndex

Index of the page to be deleted. This is a zero-based index


Return for RemovePage

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For RemoveSelectedZone

iPageIndex

Specifies the index of the page that contains the selected zone. This index is zero-based.


Return for RemoveSelectedZone

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For RemoveZone

iPageIndex

Specifies the index of the page from which to remove the zone. This is a zero-based index.


iZoneIndex Parameter For RemoveZone

iZoneIndex

Specifies the index of the zone(s) to be deleted. This is a zero-based index. Pass –1 to remove all zones.


Return for RemoveZone

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes


bstrFileName Parameter For SaveDocument

bstrFileName

Character string that contains the name of the output file to be saved.


Return for SaveDocument

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codesErrorCodes.


Return for SaveResultsToMemory

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bstrFileName Parameter For SaveSettingsFile

bstrFileName

String that contains the name of the settings file to save.


Return for SaveSettingsFile

Return Value

Return | Meaning
0 | The method call was successful.
<>0 | An error occurred, refer to Error Codes.


iIndex Parameter For SelectedLanguages

iIndex

Index into the array of language Ids. This is a zero-based index.


iPageIndex Parameter For SelectedZone

iPageIndex

Index of the page on which the zone is located. This is a zero-based index.


Return for SelectLanguages

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bSelect Parameter For SelectZone

bSelect

Flag that determines the function behavior.

Setting | Description
TRUE | Select the zone specified by the iZoneIndex parameter.
FALSE | Deselect the zone specified by the iZoneIndex parameter.


hDC Parameter For SelectZoneByPoint

hDC

Handle to a device context, such as a screen, to use as the display surface.


iPageIndex Parameter For SelectZoneByPoint

iPageIndex

Specifies the index of the page that contains the zones. This index is zero-based.


pRaster Parameter For SelectZoneByPoint

pRaster

Pointer to the raster object that references the OCR document.


Return for SelectZoneByPoint

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


x Parameter For SelectZoneByPoint

x

X coordinate of a point inside a zone.


y Parameter For SelectZoneByPoint

y

Y coordinate of a point inside a zone.


hDC Parameter For SelectZone

hDC

Handle to a device context, such as a screen, to use as the display surface.


iPageIndex Parameter For SelectZone

iPageIndex

Specifies the index of the page that contains the zone. This index is zero-based.


iZoneIndex Parameter For SelectZone

iZoneIndex

Specifies the index of the zone that will be selected or deselected. This index is zero-based.


pRaster Parameter For SelectZone

pRaster

Pointer to the raster object that references the OCR document.


Return for SelectZone

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetAutoZoneOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetHandPrintOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetOMROptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetRecognitionResultOptions

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


iPageIndex Parameter For SetRecognizedCharacters

iPageIndex

Specifies the index of the page to be updated with the recognized characters. This index is zero-based.


Return for SetRecognizedCharacters

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetSelectedZonePen

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


bCreateUD Parameter For SetUserDictionary

bCreateUD

Setting | Description
TRUE | Creates a new user dictionary in memory.
FALSE | Saves the user dictionary into the file specified in the DictionaryFileName property. If the DictionaryFileName property contains the name of an existing dictionary file, this method will load the user dictionary saved in the file.


Return for SetUserDictionary

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for SetZonePen

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


Return for ShutDown

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for StartUp

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


iPageIndex Parameter For UpdatePage

iPageIndex

Index of the page to be updated. This is a zero-based index


pRaster Parameter For UpdatePage

pRaster

Pointer to the raster object that references the image used to update the specified page in the internal list of pages that make up the OCR document.


Return for UpdatePage

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error Codes.


height Parameter For UpdateZoneArea

height

Height of the new zone area.


iPageIndex Parameter For UpdateZoneArea

iPageIndex

Index of the page that contains the zone to update. This index is zero-based.


iZoneIndex Parameter For UpdateZoneArea

iZoneIndex

Index of the zone to update. This index is zero-based.


left Parameter For UpdateZoneArea

left

Left coordinate of the new zone area.


Return for UpdateZoneArea

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes.


top Parameter For UpdateZoneArea

top

Top coordinate of the new zone area.


width Parameter For UpdateZoneArea

width

Width of the new zone area.


iPageIndex Parameter For UpdateZone

iPageIndex

Specifies the index of the page that contains the zone to be updated. This is a zero-based index.


iZoneIndex Parameter For UpdateZone

iZoneIndex

Specifies the index of the zone to be updated. This is a zero-based index.


pZone Parameter For UpdateZone

pZone

Pointer to the ILTZoneData object that contains information used to update the zone.


Return for UpdateZone

Return Value

Return | Meaning
0 | The method was successful.
<>0 | An error occurred. Refer to Error codes


bstrWord Parameter for Verification

bstrWord

Character string that contains the suggested word for the recognized word.


iZoneIndex Parameter for Verification

iZoneIndex

Specifies the index of the zone that contains the recognized word.


iPageIndex Parameter For ZoneCount

iPageIndex

Specifies the index of the page for which to get the number of zones.