1. Products
  2.   OCR
  3.   .NET
  4.   Receipt-OCR
 
  

Free C# .NET API to Recognize Data on Receipts

Open Source C# Optical Character Recognition (OCR) API that Instantly Detects, Extracts and Recognizes all Text and Data on Receipts hrough OCR.

In today's digital age, businesses and individuals alike are inundated with vast amounts of data, especially when it comes to financial transactions. Receipts, invoices, and bills pile up quickly, making it challenging to manage and extract valuable information. Fortunately, Receipt-OCR (Optical Character Recognition) libraries have emerged as powerful tools to streamline this process. The library automates the data extraction process, eliminating the need for manual entry. This saves significant time and reduces the risk of human error. The library is designed to recognize text in multiple languages, making it suitable for businesses operating internationally.

Receipt OCR is a technology that uses advanced algorithms and machine learning to convert scanned or photographed receipts into editable and searchable text. This process allows users to extract essential information from receipts automatically, such as date, merchant name, items purchased, prices, and taxes. Receipt OCR libraries are software packages or APIs that provide pre-built tools and functions for software developers and users to integrate this functionality into their applications or workflows.

Receipt-OCR makes it easier to search, store, and retrieve receipt data, making financial records more accessible for auditing, analysis, and compliance purposes. By reducing the need for manual data entry, businesses can save money on labor costs. Additionally, the reduced risk of errors can prevent costly mistakes in financial records. Retailers can use OCR to extract product information from purchase receipts, aiding in inventory tracking and management. As technology continues to advance, the Receipt-OCR library will play an increasingly vital role in modernizing and simplifying financial data management.

Previous Next

Getting Started with Receipt-OCR

The recommend way to install Receipt-OCR is using NuGet. Please use the following command for a smooth installation.

Install Receipt-OCR via NuGet

 Install-Package Receipt-OCR 

Install Receipt-OCR via GitHub

 git clone https://github.com/Asprise/receipt-ocr.git 

Recognize & Extract Text from Receipts via C#

The open source Receipt-OCR Library makes it easy for software developers to load and extract text from Receipts inside C# applications. First users need to load an image by providing complete path to the image and after that perform the OCR operation on the image. After the completion of the OCR operation, software developers can Print the extracted text or use it as needed. The following example shows how software developers can load and Extract text from a Receipt using C# commands.

How to Perform OCR Operation on to Extract Text from a Receipt Image using C#?

using System;
using Asprise.OCR;

class Program
{
    static void Main(string[] args)
    {
        // Replace 'path_to_receipt_image.jpg' with the actual path to your receipt image file.
        string imagePath = "path_to_receipt_image.jpg";

        // Create an OCR engine instance from the Receipt-OCR library.
        OCR ocr = new OCR();

        try
        {
            // Load the receipt image.
            ocr.Image = imagePath;

            // Perform OCR text extraction.
            string extractedText = ocr.Recognize();
            
            // Print the extracted text or use it as needed.
            Console.WriteLine("Extracted Text from Receipt:");
            Console.WriteLine(extractedText);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
        }
        finally
        {
            // Clean up the OCR engine.
            ocr.Dispose();
        }
    }
}

OCR Text from Two Receipts on One Image via .NET API

The open source Receipt-OCR Library allows software developers to perform OCR operation on two receipts in one image using C# .NET API. To recognize and extract text from two receipts on one image using a receipt OCR library in C#, Software developers can follow these general steps. Assuming you have an image containing two receipts side by side. First you need to load the multi-receipt image and perform OCR operation on it. After that you can split the extracted text into separate receipts based on a delimiter or pattern and Print or further process each extracted receipt. The following example demonstrates how software developers can perform Text Extraction from a Multi-Receipt Image inside C# applications.

C# Code for Text Extraction from a Multi-Receipt Image using C# API

using System;
using Asprise.OCR;

class Program
{
    static void Main(string[] args)
    {
        // Replace 'path_to_multi_receipt_image.jpg' with the actual path to your image containing two receipts.
        string imagePath = "path_to_multi_receipt_image.jpg";

        // Create an OCR engine instance from the Receipt-OCR library.
        OCR ocr = new OCR();

        try
        {
            // Load the multi-receipt image.
            ocr.Image = imagePath;

            // Perform OCR text extraction.
            string extractedText = ocr.Recognize();

            // Split the extracted text into separate receipts based on a delimiter or pattern.
            string[] receipts = extractedText.Split(new string[] { "=== RECEIPT ===" }, StringSplitOptions.RemoveEmptyEntries);

            // Print or process each extracted receipt.
            for (int i = 0; i < receipts.Length; i++)
            {
                Console.WriteLine($"Extracted Text from Receipt {i + 1}:");
                Console.WriteLine(receipts[i]);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
        }
        finally
        {
            // Clean up the OCR engine.
            ocr.Dispose();
        }
    }
}

 English