问题描述
我正在尝试使用 Kofax Capture API 并尝试编写一个自定义模块来进行扫描.为此,我需要创建一个批处理,然后对其进行处理/扫描.
I am trying to use Kofax Capture API and trying to write a custom module which will do a scan.For this i need to create a batch and then process/scan it.
无论如何要处理/扫描一批吗?
Is there anyway to process/scan a batch?
推荐答案
嗯,我不知道是否可以在自定义模块中进行.编写自定义模块时,您通常使用 Kofax Capture Optimized Custom Module API (DBLiteOpt.dll).我知道您可以使用 RuntimeSession 对象的 BatchCreate 方法使用自定义模块创建一个空批次:
Hmm, I don't know if it's possible to do inside a custom module. When writing a custom module you're typically using the Kofax Capture Optimized Custom Module API (DBLiteOpt.dll). I know you can create an empty batch with a custom module by using BatchCreate method of the RuntimeSession object:
'*** Get your Process Id
pid = m_oLogin.ProcessId '*** Create new batch
Set m_oBatch = m_oRuntimeSession.BatchCreate("SomeBatchClass", "MyBatch", pid)
不幸的是,我不知道有什么方法可以将文档导入到该批次中.
Unfortunately, I don't know of any way to import documents into that batch.
您始终可以创建一个独立的程序来导入批处理.这是一些 C# 伪代码:
You can always just create a stand-alone program that imports a batch. Here's some C# pseudo-code:
Kofax.AscentCaptureModule.ImportLogin myLogin ;
Kofax.AscentCaptureModule.Application myApp;
// login first
myLogin = new Kofax.AscentCaptureModule.ImportLogin() ;
myApp = myLogin.Login("myUsername", "myPassword") ;
// create a new batch
Kofax.AscenCaptureModule.BatchClass myBatchClass =
myApp.BatchClasses["MyBatchClassName"];
Kofax.AscentCaptureModule.Batch =
myApp.CreateBatch(ref myBatchClass, "TheNameOfMYBatch");
// create a new document and set its form type
Kofax.AscentCaptureModule.Document myDoc ;
Kofax.AscentCaptureModule.Page myPage = null ;
myDoc = myBatch.CreateDocument(null) ;
Kofax.AscentCaptureModule.FormType myFormType =
myBatch.FormTypes[1] // - just hardcoded a form type here
myDoc.set_FormType(ref myFormType) ;
// add some pages to the doc
Kofax.AscentCaptureModule.Pages myPages = myBatch.ImportFile("SomeFilePath") ;
foreach(Kofax.AscentCaptureModule.Page myPage in myPages)
{
myPage.MoveToDocument(ref myDoc, null) ;
}
myApp.CloseBatch() ;
这篇关于有没有人使用 Kofax Capture API 创建导入程序以在 Kofax 中创建批处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!