Has anyone used Kofax Capture API for creating a I

2019-05-18 04:14发布

问题:

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?

回答1:

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.

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() ;


回答2:

As a suggestion, use Kofax XML (ACXMLAID) proprietary importer, if you create your own importer, you will lose kofax team support and assistance.

My company already created an custom exporter and then rollback all projects to Kofax Database Export to get support of Kofax team.

Solving your problem: Install ACXMLAID and then save your batches as xml to ACXMLAID import to kofax.

If you need more details on how to do this, send me a message.

Thank you!



标签: api kofax