Leadtools.Document Deprecated as of v16. Refer to: Leadtools.Forms.Ocr | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
SelectLanguages Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : SelectLanguages Method



languages
Array of language ids that will be activated.
languages
Array of language ids that will be activated.
Activates the already specified languages into the OCR document engine.

Syntax

Visual Basic (Declaration) 
Public Sub SelectLanguages( _
   ByVal languages() As RasterDocumentLanguage _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim languages() As RasterDocumentLanguage
 
instance.SelectLanguages(languages)
C# 
public void SelectLanguages( 
   RasterDocumentLanguage[] languages
)
C++/CLI 
public:
void SelectLanguages( 
   array<RasterDocumentLanguage>^ languages
) 

Parameters

languages
Array of language ids that will be activated.

Example

Visual BasicCopy Code
Public Sub SelectLanguagesExample()
   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   Dim rasterDocument As RasterDocumentEngine
   rasterDocument = RasterDocumentEngine.Instance
   rasterDocument.Startup()

   Dim lang As RasterDocumentLanguage() = New RasterDocumentLanguage(0) {}

   Try
      lang(0) = RasterDocumentLanguage.English
      rasterDocument.SelectLanguages(lang)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

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

   If rasterDocument.LanguageCharacterFilter <> RasterDocumentCharacterFilter.All Then
      rasterDocument.LanguageCharacterFilter = RasterDocumentCharacterFilter.All
   End If

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void SelectLanguagesExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   RasterDocumentLanguage[] lang = new RasterDocumentLanguage[1]; 
 
   try 
   { 
      lang[0] = RasterDocumentLanguage.English; 
      rasterDocument.SelectLanguages(lang); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
 
   rasterDocument.LanguageCharacterPlus = "Test Plus"; 
   rasterDocument.LanguageCharacterPlusFilter = "Test Plus Filter"; 
 
   if (rasterDocument.LanguageCharacterFilter != RasterDocumentCharacterFilter.All) 
      rasterDocument.LanguageCharacterFilter = RasterDocumentCharacterFilter.All; 
 
   rasterDocument.Shutdown(); 
}

Remarks

Defines the main part of the Language environment of the Character Set.
If this method is not called to specify the language(s) to be recognized, the default language, the English language, is applied.
To get the current activated languages, use the SelectedLanguages property.
The following properties are used to set or get the character options for the current activated languages: To recognize page or set of pages, call Recognize.
For more information, refer to Working with Languages.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

The Leadtools.Document namespace is deprecated and no longer supported as of LEADTOOLS v16. For v16 and later, please refer to: Leadtools.Forms.Ocr. This documentation is retained for v15 and earlier informational use only.