Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
SelectLanguages Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : SelectLanguages Method




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
)
Managed Extensions for 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 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features