←Select platform

RunParallelPipesOnDemand(AutoFormsParallelRunItemGetterFileName,object,AutoFormsParallelRunResultFileNameCallback,int) Method

Summary

Runs the AutoFormsEngine on demand for file paths.

Syntax

C#
C++/CLI
Python
def RunParallelPipesOnDemand(self,fileNamesGetter,getterUserData,callback,pipesCount): 

Parameters

fileNamesGetter

Callback to get the file path.

getterUserData

Optional object to be passed to the getter.

callback

Callback for each input file after processing.

pipesCount

Number of parallel threads used to consume the input data.

Example

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Auto; 
using Leadtools.Document; 
using Leadtools.Ocr; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Processing; 
using Leadtools.Barcode; 
 
using Leadtools.Forms; 
 
 
public void ResultCallback1(string fileName, AutoFormsRunResult result, int itemIndex, object label) 
{ 
   if (result == null) 
   { 
      Console.WriteLine($"ERROR!!!: Failed to process {label}: [{itemIndex}] {fileName}"); 
   } 
   else 
   { 
      Console.WriteLine($"Successfully processed {label}: [{itemIndex}] {fileName}"); 
      foreach (FormPage page in result.FormFields) 
      { 
         foreach (FormField field in page) 
         { 
            Console.WriteLine($"Process for the field {field.Name} is {field.Result.Status} "); 
         } 
      } 
   } 
} 
 
public void ProcessFormsMultiProcessOnDemand(AutoFormsEngine autoEngine, List<string> fileNames, List<string> repositoryNames) 
{ 
   int nextItemIndex = -1; 
 
   AutoFormsParallelRunItemGetterFileName getter = (ref string file, ref object itemUserData, ref string repositoryName, object getterUserData) => 
   { 
      int index = Interlocked.Increment(ref nextItemIndex); 
 
      if (index >= fileNames.Count) 
         return; 
 
      file = fileNames[index]; 
      repositoryName = repositoryNames == null ? null : repositoryNames[index]; 
   }; 
 
   autoEngine.RunParallelPipesOnDemand( 
       getter, 
       null, 
       ResultCallback1, 
       8 
   ); 
} 

Requirements

Target Platforms

See Also

AutoFormsEngine Class

AutoFormsEngine Members

Leadtools.Forms.Auto Namespace

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Auto Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.