Occurs when a job is being run to provide progress status and ability to abort.
event EventHandler<OcrAutoRecognizeJobProgressEventArgs> JobProgress Event JobProgress As EventHandler(Of OcrAutoRecognizeJobProgressEventArgs) - (void)autoRecognizeManager:(LTOcrAutoRecognizeManager *)manager progress:(LTOcrProgressData *)progressData event EventHandler<OcrAutoRecognizeJobProgressEventArgs^>^ JobProgress The event handler receives an argument of type OcrAutoRecognizeJobProgressEventArgs containing data related to this event. The following OcrAutoRecognizeJobProgressEventArgs properties provide information specific to this event.
| Property | Description |
|---|---|
| Data | Gets the event progress data. |
| Job | Gets the job that triggered the event. |
Note, this event will not trigger if multiple threads are used on the same document (the value of MaximumThreadsPerJob is anything else but 1).
This event will occur when Run, RunJob or RunJobAsync is called.
For more information, refer to OcrAutoRecognizeJobProgressEventArgs and OcrProgressCallback.
using Leadtools;using Leadtools.Codecs;using Leadtools.Forms.Ocr;using Leadtools.Forms.DocumentWriters;using Leadtools.Forms;using Leadtools.WinForms;public void JobProgressExample(){string tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif");string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.pdf");// Create an instance of the engineusing (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false)){// Start the engine using default parametersConsole.WriteLine("Starting up the engine...");ocrEngine.Startup(null, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);IOcrAutoRecognizeManager ocrAutoRecognizeManager = ocrEngine.AutoRecognizeManager;// Run the job in 1 threadocrAutoRecognizeManager.MaximumThreadsPerJob = 1;// Create the jobOcrAutoRecognizeJobData ocrJobData = new OcrAutoRecognizeJobData(tifFileName, DocumentFormat.Pdf, pdfFileName);ocrJobData.JobName = "MyJob";IOcrAutoRecognizeJob ocrJob = ocrAutoRecognizeManager.CreateJob(ocrJobData);// Subscribe to the JobProgress eventocrAutoRecognizeManager.JobProgress += new EventHandler<OcrAutoRecognizeJobProgressEventArgs>(ocrAutoRecognizeManager_JobProgress);// Run the jobocrAutoRecognizeManager.RunJob(ocrJob);// Unsubscribe to the JobProgress eventocrAutoRecognizeManager.JobProgress -= new EventHandler<OcrAutoRecognizeJobProgressEventArgs>(ocrAutoRecognizeManager_JobProgress);}}private static void ocrAutoRecognizeManager_JobProgress(object sender, OcrAutoRecognizeJobProgressEventArgs e){Console.WriteLine(string.Format("Job: {0} - Page: {1}:{2} - {3} - {4}%",e.Job.JobData.JobName, e.Data.CurrentPageIndex + 1, e.Data.LastPageIndex + 1, e.Data.Operation, e.Data.Percentage));}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";public const string OcrAdvantageRuntimeDir = @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Forms.OcrImports Leadtools.Forms.DocumentWritersImports Leadtools.FormsImports Leadtools.WinForms<TestMethod>Public Sub JobProgressExample()Dim tifFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif")Dim pdfFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.pdf")' Create an instance of the engineUsing ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)' Start the engine using default parametersConsole.WriteLine("Starting up the engine...")ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrAdvantageRuntimeDir)Dim ocrAutoRecognizeManager As IOcrAutoRecognizeManager = ocrEngine.AutoRecognizeManager' Run the job in 1 threadocrAutoRecognizeManager.MaximumThreadsPerJob = 1' Create the jobDim ocrJobData As New OcrAutoRecognizeJobData(tifFileName, DocumentFormat.Pdf, pdfFileName)ocrJobData.JobName = "MyJob"Dim ocrJob As IOcrAutoRecognizeJob = ocrAutoRecognizeManager.CreateJob(ocrJobData)' Subscribe to the JobProgress eventAddHandler ocrAutoRecognizeManager.JobProgress, AddressOf ocrAutoRecognizeManager_JobProgress' Run the jobocrAutoRecognizeManager.RunJob(ocrJob)' Unsubscribe to the JobProgress eventRemoveHandler ocrAutoRecognizeManager.JobProgress, AddressOf ocrAutoRecognizeManager_JobProgressEnd UsingEnd SubPrivate Shared Sub ocrAutoRecognizeManager_JobProgress(sender As Object, e As OcrAutoRecognizeJobProgressEventArgs)Console.WriteLine(String.Format("Job: {0} - Page: {1}:{2} - {3} - {4}%",e.Job.JobData.JobName,e.Data.CurrentPageIndex + 1,e.Data.LastPageIndex + 1,e.Data.Operation,e.Data.Percentage))End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"Public Const OcrAdvantageRuntimeDir As String = "C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime"End Class
|
Products |
Support |
Feedback: JobProgress Event - Leadtools.Forms.Ocr |
Introduction |
Help Version 19.0.2017.6.6
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.