Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement