Beispiel #1
0
        /// <summary>
        /// Advanced. It's user's responsibility to displose MiDoc properly.
        /// </summary>
        public MiDoc Process(string inputFile)
        {
            Document doc = new Document();

            doc.OnOCRProgress += new _IDocumentEvents_OnOCRProgressEventHandler(this.OnProgress);

            try
            {
                doc.Create(inputFile);
                doc.OCR(MiLanguageMapper.ToMiLanguage(_opt.Language), _opt.WithAutoRotation, _opt.WithStraightenImage);
            }
            catch (System.Exception)
            {
                _errorFiles.Add(inputFile);

                doc.Close(false);
                doc = null;
                return(null);
            }

            return(new MiDoc(doc));
        }
Beispiel #2
0
 public void OCR(OcrOption opt)
 {
     _image.OCR(MiLanguageMapper.ToMiLanguage(opt.Language), opt.WithAutoRotation, opt.WithStraightenImage);
 }