Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (RasterCodecs codecs = new RasterCodecs())
- {
- string masterFormRepository = @"Invoice Master Form Path";
- string filledFormDirectory = @"Filled Invoice Path";
- using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false))
- {
- ocrEngine.Startup(codecs, null, null, null);
- IMasterFormsRepository repository = new DiskMasterFormsRepository(codecs, masterFormRepository);
- using (AutoFormsEngine engine = new AutoFormsEngine(repository, ocrEngine, null, AutoFormsRecognitionManager.Default | AutoFormsRecognitionManager.Ocr, 30, 80, false))
- {
- foreach (var file in Directory.EnumerateFiles(filledFormDirectory))
- {
- using (RasterImage image = codecs.Load(file))
- {
- //Run the recognition
- AutoFormsRunResult runResult = engine.Run(image, null, null, null);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement