公共事件EventHandler <OcrAutoRecognizeJobProgressEventArgs> JobProgress
事件JobProgress作为EventHandler (OcrAutoRecognizeJobProgressEventArgs)
- (无效)autoRecognizeManager: (LTOcrAutoRecognizeManager *)经理进展:progressData (LTOcrProgressData *)
事件EventHandler < OcrAutoRecognizeJobProgressEventArgs ^ > ^ JobProgress
事件处理程序接收一个参数的类型OcrAutoRecognizeJobProgressEventArgs包含的数据与这一事件有关。以下OcrAutoRecognizeJobProgressEventArgs属性提供特定于该事件的信息。
财产 | 描述 |
---|---|
数据 | 事件进展数据。 |
注意,这个事件不会触发如果使用多个线程在同一文档的值MaximumThreadsPerJob是什么但1)。
这个事件将会发生运行,RunJob或RunJobAsync被称为。
有关更多信息,请参考OcrAutoRecognizeJobProgressEventArgs和OcrProgressCallback。
使用Leadtools;
使用Leadtools.Codecs;
使用Leadtools.Ocr;
使用Leadtools.Document.Writer;
使用Leadtools.Forms.Common;
使用Leadtools.WinForms;
公共无效JobProgressExample ()
{
字符串tifFileName = Path.Combine (LEAD_VARS.ImagesDir,“Ocr1.tif”);
字符串pdfFileName = Path.Combine (LEAD_VARS.ImagesDir,“Ocr1.pdf”);
/ /创建一个实例的引擎
使用(IOcrEngine ocrEngine = OcrEngineManager.CreateEngine (OcrEngineType.LEAD))
{
/ /启动引擎使用默认参数
Console.WriteLine (“启动引擎…”);
ocrEngine.Startup (零,零,零,LEAD_VARS.OcrLEADRuntimeDir);
IOcrAutoRecognizeManager ocrAutoRecognizeManager = ocrEngine.AutoRecognizeManager;
/ / 1线程中运行作业
ocrAutoRecognizeManager。MaximumThreadsPerJob = 1;
/ /创建工作
OcrAutoRecognizeJobData ocrJobData =新OcrAutoRecognizeJobData (tifFileName DocumentFormat。Pdf, pdfFileName);
ocrJobData。JobName =“MyJob”;
IOcrAutoRecognizeJob ocrJob = ocrAutoRecognizeManager.CreateJob (ocrJobData);
/ /订阅JobProgress事件
ocrAutoRecognizeManager。JobProgress + =新EventHandler < OcrAutoRecognizeJobProgressEventArgs > (ocrAutoRecognizeManager_JobProgress);
/ /运行工作
ocrAutoRecognizeManager.RunJob (ocrJob);
/ /退订JobProgress事件
ocrAutoRecognizeManager。JobProgress - =新EventHandler < OcrAutoRecognizeJobProgressEventArgs > (ocrAutoRecognizeManager_JobProgress);
}
}
私人静态无效ocrAutoRecognizeManager_JobProgress (对象发送方,OcrAutoRecognizeJobProgressEventArgs e)
{
Console.WriteLine (字符串.Format (“工作:{0}页:{1},{2},{3},{4}%”,
e.Job.JobData.JobName,e.Data。e.Data CurrentPageIndex + 1。e.Data LastPageIndex + 1。操作,e.Data.Percentage));
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
公共常量字符串OcrLEADRuntimeDir =@“C: \ LEADTOOLS21 \ Bin \常见\ OcrLEADRuntime”;
}
进口Leadtools
进口Leadtools.Codecs
进口Leadtools.Ocr
进口Leadtools.Document.Writer
进口Leadtools.Forms.Common
进口Leadtools.WinForms
公共子JobProgressExample ()
昏暗的tifFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Ocr1.tif”)
昏暗的pdfFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Ocr1.pdf”)
创建一个实例的引擎
使用ocrEngine作为IOcrEngine = OcrEngineManager.CreateEngine (OcrEngineType.LEAD)
“启动引擎使用默认参数
Console.WriteLine (“启动引擎…”)
ocrEngine.Startup (没有什么,没有什么,没有什么LEAD_VARS.OcrLEADRuntimeDir)
昏暗的ocrAutoRecognizeManager作为IOcrAutoRecognizeManager = ocrEngine.AutoRecognizeManager
“在1线程运行工作
ocrAutoRecognizeManager。MaximumThreadsPerJob = 1
“创建工作
昏暗的ocrJobData作为新OcrAutoRecognizeJobData (tifFileName DocumentFormat。Pdf, pdfFileName)
ocrJobData。JobName =“MyJob”
昏暗的ocrJob作为IOcrAutoRecognizeJob = ocrAutoRecognizeManager.CreateJob (ocrJobData)
“订阅JobProgress事件
AddHandlerocrAutoRecognizeManager.JobProgress,AddressOfocrAutoRecognizeManager_JobProgress
“运行工作
ocrAutoRecognizeManager.RunJob (ocrJob)
“退订JobProgress事件
RemoveHandlerocrAutoRecognizeManager.JobProgress,AddressOfocrAutoRecognizeManager_JobProgress
结束使用
结束子
私人共享子ocrAutoRecognizeManager_JobProgress(发送方作为对象e作为OcrAutoRecognizeJobProgressEventArgs)
Console.WriteLine (字符串.Format (“工作:{0}页:{1},{2},{3},{4}%”,
e.Job.JobData.JobName,
e.Data。CurrentPageIndex + 1,
e.Data。LastPageIndex + 1,
e.Data.Operation,
e.Data.Percentage))
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
公共常量OcrLEADRuntimeDir作为字符串=“C: \ LEADTOOLS21 \ Bin \常见\ OcrLEADRuntime”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗Web查看器net
188宝金博怎么下载
支持的平台上
net, Java, Android和iOS / macOS组件
C / c++类库的API
HTML5 JavaScript库
你的邮件已经发送到支持!有人应该联系!如果你的问题是紧急请回到聊天。
聊天时间:
周一——周五,上午6点等
谢谢你的反馈!
请填写表单重新开始一个新的聊天。
所有代理目前离线。
聊天时间:
周一-周五
早上8:30 - 6点
联系我们请填写这张表格,我们将通过电子邮件联系你。