SHARE
TWEET

Untitled

a guest Jun 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using (RasterCodecs codecs = new RasterCodecs())
  2. {
  3.     string masterFormRepository = @"Invoice Master Form Path";
  4.     string filledFormDirectory = @"Filled Invoice Path";
  5.     using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false))
  6.     {
  7.         ocrEngine.Startup(codecs, null, null, null);
  8.         IMasterFormsRepository repository = new DiskMasterFormsRepository(codecs, masterFormRepository);
  9.         using (AutoFormsEngine engine = new AutoFormsEngine(repository, ocrEngine, null, AutoFormsRecognitionManager.Default | AutoFormsRecognitionManager.Ocr, 30, 80, false))
  10.         {
  11.             foreach (var file in Directory.EnumerateFiles(filledFormDirectory))
  12.             {
  13.                 using (RasterImage image = codecs.Load(file))
  14.                 {
  15.                     //Run the recognition
  16.                     AutoFormsRunResult runResult = engine.Run(image, null, null, null);
  17.                 }
  18.             }
  19.         }
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top