←Select platform

OcrEngineType Enumeration

Specifies available OCR engine types.
public enum OcrEngineType 
typedef NS_ENUM(NSInteger, LTOcrEngineType) { 
 LTOcrEngineTypeLEAD = 0 
public enum OcrEngineType 
public enum class OcrEngineType   
Value Member Description
0 LEAD LEAD specifies the LEADTOOLS OCR Module - LEAD Engine. Internally, the OCR library inside Leadtools.Ocr.LEADEngine.dll is used.
Note: The LEAD OCR engine is the only engine that can be used when targeting platforms other than Windows.
For more information, refer to OCR Files to be Included With Your Application.

An OcrEngineType enumeration member is passed as a parameter to the OcrEngineManager.CreateEngine method to determine the type of engine to use. When the engine is created successfully, the engine type will be store in the IOcrEngine.EngineType property.

using Leadtools; 
using Leadtools.Ocr; 
using Leadtools.Document.Writer; 
using Leadtools.Codecs; 
public void CreateEngineExample() 
   // Create an instance of the engine 
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)) 
      // Start the engine using default parameters 
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
      string tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif"); 
      string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.pdf"); 
      // Create an OCR document 
      using (IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument()) 
         // Add a page to the document 
         IOcrPage ocrPage = ocrDocument.Pages.AddPage(tifFileName, null); 
         // Recognize the page 
         // Note, Recognize can be called without calling AutoZone or manually adding zones. The engine will 
         // check and automatically auto-zones the page 
         // Save the document we have as PDF 
         ocrDocument.Save(pdfFileName, DocumentFormat.Pdf, null); 
      // Shutdown the engine 
      // Note: calling Dispose will also automatically shutdown the engine if it has been started 
static class LEAD_VARS 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime"; 

Target Platforms

Help Version 22.0.2023.2.4
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Ocr Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.