←Select platform

JobName Property

Summary
Gets or sets the optional job name.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public string JobName { get; set; } 
@property (nonatomic, copy, nullable) NSString *jobName; 
public String getJobName() 
public void setJobName(String value) 
public: 
property String^ JobName { 
   String^ get(); 
   void set (    String^ ); 
} 
JobName # get and set (OcrAutoRecognizeJobData) 

Property Value

A String that contains the optional job name. If tracing is enabled with IOcrAutoRecognizeManager.EnableTrace, then the engine will use this value in the trace messages. If this member is a null reference, then the trace will show the generic [Untitled] name next to the trace messages.

Remarks

Note: The maximum length for this string is 79 characters. Strings longer than 79 characters are truncated to 79 characters.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Ocr; 
using Leadtools.Document.Writer; 
using Leadtools.Forms.Common; 
using Leadtools.WinForms; 
 
private AutoResetEvent _jobFinishedEvent; 
 
public void RunJobAsyncExample() 
{ 
   string tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif"); 
   string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.pdf"); 
 
   // Create an instance of the engine 
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)) 
   { 
      // Start the engine using default parameters 
      Console.WriteLine("Starting up the engine..."); 
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
 
      IOcrAutoRecognizeManager ocrAutoRecognizeManager = ocrEngine.AutoRecognizeManager; 
 
      // Create the job 
      OcrAutoRecognizeJobData ocrJobData = new OcrAutoRecognizeJobData(tifFileName, DocumentFormat.Pdf, pdfFileName); 
      ocrJobData.JobName = "MyJob"; 
      IOcrAutoRecognizeJob ocrJob = ocrAutoRecognizeManager.CreateJob(ocrJobData); 
 
      // Create the event 
      _jobFinishedEvent = new AutoResetEvent(false); 
 
      // Run the job in a thread and wait for it to be done 
      // We will use the JobCompleted event to get notified when 
      // the job is finished 
      ocrAutoRecognizeManager.JobCompleted += new EventHandler<OcrAutoRecognizeRunJobEventArgs>(ocrAutoRecognizeManager_JobCompleted); 
      Console.WriteLine("Running the job..."); 
      ocrAutoRecognizeManager.RunJobAsync(ocrJob); 
 
      Console.WriteLine("Waiting for the job to complete..."); 
      _jobFinishedEvent.WaitOne(); 
      Console.WriteLine("Done..."); 
      _jobFinishedEvent.Close(); 
      ocrAutoRecognizeManager.JobCompleted -= new EventHandler<OcrAutoRecognizeRunJobEventArgs>(ocrAutoRecognizeManager_JobCompleted); 
   } 
} 
 
private void ocrAutoRecognizeManager_JobCompleted(object sender, OcrAutoRecognizeRunJobEventArgs e) 
{ 
   // Tell main thread we are done 
   _jobFinishedEvent.Set(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
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.