1

Is there any free/paid OCR library that able to capture the invoices data in PDF format? Need to have a low error rate. We need to take those data and do some further processing.

0

The LEADTOOLS toolkit is a professional SDK that provides the ability to recognize multiple field types using OCR for detection and extraction.

If the invoice image or document you are extracting from has an organized and defined structure, you can use the LEADTOOLS Forms Recognition and Processing features (https://www.leadtools.com/sdk/forms) to create a single template with multiple data field defined in it to extract from multiple filled sheets. (Disclaimer: I am an employee of the vendor of this toolkit)

The code to extract text from an invoice master form template with defined fields would look like this:

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);
                }
            }
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.