Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, March 20, 2018 4:32:55 AM(UTC)

Morne  
Morne

Groups: Registered
Posts: 1


Hi,

i have used the demo program to create a master form template and tested it with the OCR demo program.

Everything works fine.

but, i have created my own program, but the data is inconsistent.

for instance the bar code does not return any data.

here is my code:


Code:

            string filename = @"C:\Users\***\MasterFormTest21.tif";

            _documentGrid = new gridControl(_confirmationsAdapter, selecteddocumentType)
            {
                Parent = MainPanel,
                Dock = DockStyle.Fill
            };

           MainPanel.Controls.Add(_documentGrid);

            string repositoryPath = @"C:\Users\***\singleForm\";

            rasterCodecs = new RasterCodecs();

            DiskMasterFormsRepository repository = new DiskMasterFormsRepository(rasterCodecs, repositoryPath);

            IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false);

            ocrEngine.Startup(null, null, null, @"C:\Development\SDK\LEADTOOLS 19\Bin\Common\OcrProfessionalRuntime");

            BarcodeEngine barcodeEngine = new BarcodeEngine();

            AutoFormsRecognitionManager managers = AutoFormsRecognitionManager.None;

            managers |= AutoFormsRecognitionManager.Ocr;


            autoEngine = new AutoFormsEngine(repository, ocrEngine, barcodeEngine, managers, 30, 80, true)
            {
                RecognizeFirstPageOnly = true,
                FilledFormType = Leadtools.Forms.FormsPageType.Normal
            };

            try
            {
                CodecsImageInfo info = rasterCodecs.GetInformation(filename, true);

                for (int page = 1; page <= info.TotalPages; page++)
                {
                    RasterImage image = rasterCodecs.Load(filename, page);

                    AutoFormsRunResult result = autoEngine.Run(filename, null);

                    if (result != null)
                    {

                        if (result.FormFields != null && result.RecognitionResult.MasterForm != null)
                        {

                            foreach (FormPage formPage in result.FormFields)
                            {

                                foreach (FormField formField in formPage)
                                {
                                    if (formField is BarcodeFormField)
                                    {

                                        string barCode = string.Empty;

                                        for (int i = 0; i < ((formField as BarcodeFormField).Result as BarcodeFormFieldResult).BarcodeData.Count; i++)
                                        {
                                            barCode = GetDataString((((formField as BarcodeFormField).Result as BarcodeFormFieldResult).BarcodeData[i].GetData()));
                                        }

                                        Console.WriteLine(barCode);

                                    }


                                }



                            }

                        }


                    }


                }


            }
            catch (Exception)
            {

                throw;
            }

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, March 21, 2018 8:30:07 AM(UTC)

Joe Z  
Joe Z

Groups: Registered, Tech Support, Administrators
Posts: 63

Thanks: 2 times
Was thanked: 4 time(s) in 4 post(s)

Morne,

It appears that you currently have an ongoing case with our support department regarding this issue. We'll work on this case via email as we need additional information on how to reproduce this.
Joe Zhan
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.100 seconds.