我正在尝试使用Kofax Capture API并尝试编写一个可以进行扫描的自定义模块.为此,我需要创建一个批处理,然后处理/扫描它.
无论如何处理/扫描批次?
嗯,我不知道是否可以在自定义模块中进行.编写自定义模块时,通常使用Kofax Capture优化自定义模块API(DBLiteOpt.dll).我知道您可以使用RuntimeSession对象的BatchCreate方法创建一个带有自定义模块的空批处理:
'*** Get your Process Id
pid = m_oLogin.ProcessId '*** Create new batch
Set m_oBatch = m_oRuntimeSession.BatchCreate("SomeBatchClass", "MyBatch", pid)
Run Code Online (Sandbox Code Playgroud)
不幸的是,我不知道将文件导入该批次的任何方法.
您始终可以创建一个导入批处理的独立程序.这是一些C#伪代码:
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() ;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6041 次 |
| 最近记录: |