Leadtools.Forms.Ocr Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
GetSupportedLanguageGroups Method
See Also  Example
Leadtools.Forms.Ocr Namespace > IOcrLanguageManager Interface : GetSupportedLanguageGroups Method



Gets the current language groups installed on the system.

Syntax

Visual Basic (Declaration) 
Overridable Function GetSupportedLanguageGroups() As OcrLanguageGroup()
Visual Basic (Usage)Copy Code
Dim instance As IOcrLanguageManager
Dim value() As OcrLanguageGroup
 
value = instance.GetSupportedLanguageGroups()
C# 
virtual OcrLanguageGroup[] GetSupportedLanguageGroups()
C++/CLI 
virtual array<OcrLanguageGroup>^ GetSupportedLanguageGroups(); 

Return Value

An array of OcrLanguageGroup values containing the language groups installed on the system.

Example

This example will list the language groups installed on the system.

Visual BasicCopy Code
Public Sub OcrLanguageGroupsExample()
   ' Unlock the support needed for LEADTOOLS Plus OCR engine
   RasterSupport.Unlock(RasterSupportType.Document, "Replace with your own key here")
   RasterSupport.Unlock(RasterSupportType.OcrPlus, "Replace with your own key here")
   RasterSupport.Unlock(RasterSupportType.OcrPlusPdfLeadOutput, "Replace with your own key here")
   ' Create an instance of the engine
   Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, False)
      ' Start the engine using default parameters
      ocrEngine.Startup(Nothing, Nothing, Nothing, Nothing)

      ' Get and show the supported (installed) language groups
      Dim supportedGroups() As OcrLanguageGroup = ocrEngine.LanguageManager.GetSupportedLanguageGroups()

      Console.WriteLine("Supported (installed) groups:")
      For Each supportedGroup As OcrLanguageGroup In supportedGroups
         Console.WriteLine(" {0}", supportedGroup)
      Next

      ' Show that you can use IsLanguageGroupSupported to check for a specific group

      ' Check if Latin1 is installed
      Dim latin1Installed As Boolean = ocrEngine.LanguageManager.IsLanguageGroupSupported(OcrLanguageGroup.Latin1)
      If (latin1Installed) Then
         Console.WriteLine("Latin1 is installed")
      End If

      ocrEngine.Shutdown()
   End Using
End Sub
C#Copy Code
public void OcrLanguageGroupsExample() 

   // Unlock the support needed for LEADTOOLS Plus OCR engine 
   RasterSupport.Unlock(RasterSupportType.Document, "Replace with your own key here"); 
   RasterSupport.Unlock(RasterSupportType.OcrPlus, "Replace with your own key here"); 
   RasterSupport.Unlock(RasterSupportType.OcrPlusPdfLeadOutput, "Replace with your own key here"); 
   // Create an instance of the engine 
   using(IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, false)) 
   { 
      // Start the engine using default parameters 
      ocrEngine.Startup(null, null, null, null); 
 
      // Get and show the supported (installed) language groups 
      OcrLanguageGroup[] supportedGroups = ocrEngine.LanguageManager.GetSupportedLanguageGroups(); 
 
      Console.WriteLine("Supported (installed) groups:"); 
      foreach(OcrLanguageGroup supportedGroup in supportedGroups) 
      { 
         Console.WriteLine("  {0}", supportedGroup); 
      } 
 
      // Show that you can use IsLanguageGroupSupported to check for a specific group 
 
      // Check if Latin1 is installed 
      bool latin1Installed = ocrEngine.LanguageManager.IsLanguageGroupSupported(OcrLanguageGroup.Latin1); 
      if(latin1Installed) 
         Console.WriteLine("Latin1 is installed"); 
 
      ocrEngine.Shutdown(); 
   } 
}

Remarks

Use the IsLanguageGroupSupported method to determine if an individual language group is installed on the system.

The various LEADTOOLS OCR engines ships with default OCR language packs. Additional language packs can be downloaded from the LEAD Technologies' website at http://www.leadtools.com.

The language environment defines the character set(s) recognized by the OCR engine. For example, if you enable the English and German languages, the German characters (ä, Ä, é, ö, Ö, ü, Ü, ß) will be combined with the English characters to define the set recognized by the engine. The language environment does not perform spell checking however, for that, refer to IOcrSpellCheckManager.

Requirements

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

See Also

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