Пример #1
0
        public MasterForm LoadMasterForm(string attributesFileName, string fieldsFileName)
        {
            FormProcessingEngine tempProcessingEngine = new FormProcessingEngine();

            tempProcessingEngine.OcrEngine = OcrEngine;
            //tempProcessingEngine.BarcodeEngine = null;

            MasterForm form = new MasterForm();

            if (File.Exists(attributesFileName))
            {
                byte[] formData = File.ReadAllBytes(attributesFileName);
                form.Attributes.SetData(formData);
                form.Properties = RecognitionEngine.GetFormProperties(form.Attributes);
            }

            if (File.Exists(fieldsFileName))
            {
                tempProcessingEngine.LoadFields(fieldsFileName);
                form.Resolution      = tempProcessingEngine.Pages[0].DpiX;
                form.ProcessingPages = tempProcessingEngine.Pages;
            }

            return(form);
        }
Пример #2
0
        // Read the fields of this master form
        public FormPages ReadFields()
        {
            if (!File.Exists(_path + ".xml"))
            {
                return(null);
            }
            _processingEngine.LoadFields(_path + ".xml");
            //to create new forms pages
            FormProcessingEngine tempProcessingEngine = new FormProcessingEngine();
            FormPages            formFields           = tempProcessingEngine.Pages;

            formFields.AddRange(_processingEngine.Pages);
            return(formFields);
        }