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
SelectedLanguages Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : SelectedLanguages Method



Gets the current selected languages.

Syntax

Visual Basic (Declaration) 
Public Function SelectedLanguages() As RasterDocumentLanguage()
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim value() As RasterDocumentLanguage
 
value = instance.SelectedLanguages()
C# 
public RasterDocumentLanguage[] SelectedLanguages()
C++/CLI 
public:
array<RasterDocumentLanguage>^ SelectedLanguages(); 

Example

Visual BasicCopy Code
Public Sub SelectedLanguagesExample()
   ' 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() = rasterDocument.SelectedLanguages()
   MessageBox.Show("Total Selected Languages = " & lang.Length)

   Dim i As Integer = 0
   Do While i < lang.Length
      If lang(i) = RasterDocumentLanguage.English Then
         MessageBox.Show("English is active language")
      End If
      i += 1
   Loop

   If rasterDocument.IsCharacterEnabled("a"c) Then
      MessageBox.Show("The specified character is available in the selected langauges")
   Else
      MessageBox.Show("The specified character is not available in the selected langauges")
   End If

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

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(RasterSupportType.Ocr, "TestKey"); 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   RasterDocumentLanguage[] lang = rasterDocument.SelectedLanguages(); 
   MessageBox.Show("Total Selected Languages = " + lang.Length); 
 
   for(int i=0; i <lang.Length; i++) 
   { 
      if (lang[i] == RasterDocumentLanguage.English) 
         MessageBox.Show("English is active language"); 
   } 
 
   if (rasterDocument.IsCharacterEnabled('a')) 
      MessageBox.Show("The specified character is available in the selected langauges"); 
   else 
      MessageBox.Show("The specified character is not available in the selected langauges"); 
 
   rasterDocument.Shutdown(); 
}

Remarks

Retrieves an array that contains the current language selections.
To activate recognized languages, call SelectLanguages. The following properties are used to set or get the character options for the current activated languages: 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.