Optical Character Recognition (OCR) in C#

This post will help you to create an OCR application in C#. For this, I will be using Visual Studio 2013 and Puma.NET. Before creating the project you need to install Puma.NET on your computer. You can download Puma.NET from here.

After downloading, run the installer to install Puma.NET on your device. The default installation folder will be C:\ProgramFiles (x86) on 32 bit systems. After finishing installation you will have three folders under C:\ProgramFiles (x86)\Puma.NET.

Open Assemblies folder and there you will have three DLLs named dibapi.dll, puma.interop.dll and Puma.Net.dll.

Create a Windows Forms Application and add a Button and RichTextBox to the form.

Right click on Project -> Add References.

Select Browse and add Puma.Net.dll from the Assemblies folder under installation path of Puma.NET.

Click on Build to build your project.

Open Debug folder of the project and there will be puma.interop.dll and Puma.Net.dll in the folder.

Copy dibapi.dl (C:\ProgramFiles (x86)\Puma.NET\Assemblies) to the Debug folder of your project. This is how the Debug folder will look like.

Double click on the Browse button to create an event handler for the button and add this code.