Visual C#.NET: Recognize, Process Forms on Document

How to Forms on document image using C#.NET
Yiigo.Image for .NET provides advanced Forms Recognition support, allowing developers to recognize and process any forms on documents and images from documents and images in bitonal, color and grayscale. Find more Forms information on Yiigo.Imaging for .NET Forms Plugin.
Yiigo.Imaging for .NET Forms Plugin has those following functionalities:
  • Detect, recognize forms from files, stream and scanners
  • Process forms before forms recognition
  • Identify, align forms
  • Extract fields of hand-printed text, typed text, check marks or bubble marks
  • Recognize forms from local directory or scanners
  • Deskew, despeckle forms
  • Detect, extract barcodes in forms
This document provides comprehensive Visual C#.NET samples for guiding developers to recognize, process forms on documents and images using Yiigo.Image for .NET. Find more Forms recognition and processing tutorials on VB.NET Forms Recognition & Processing, Web Imaging Viewer Forms Recognition & Processing Support and Recognize & Process Forms in .NET Winforms.
Recognize & Process Forms with C#.NET Sample Code


Before starting to recognize forms in Visual C#.NET, make sure that you have installed.

Start to Recognize & Process Forms

  • Open and run your Microsoft Visual Studio;
  • Choose either "Visual C# Projects" in "New Project" dialog box;
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingFormsCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the context menu in the "Solution Explorer" window;
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library, Yiigo.Imaging.Net.Forms.Recognition.dll and Yiigo.Imaging.Net.Forms.Processing.dll;
  • Add it to your Visual C# applications;
  • Call Yiigo .NET Image Namespace & Copy those following codes:
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
using Yiigo.Imaging.Forms.Recognition;
using Yiigo.Imaging.Forms.Processing;

// Initialize Forms
//Create engine instance
FormsRecognition FormsRecognition = new FormsRecognition();

//Load Forms Template
FormsTemplateDoc forms = forms.Load(@"C:\sample.Forms");

//Load Document on which to perform forms
FileSystemImageSource imageSource = new FileSystemImageSource(@"C:\sample.tif", true);

//Perform Forms
FormsDocument results = FormsRecognition.RecognizeDocument(imageSource, docTemplate);

// Process forms
FormDocPage formPage = new FormDocPage(2, 100, 100);
FormTextField field = new FormTextField();
field.Name ="11";
field.Bounds = new LogicalRectangle(42,150, 102, 40, LogicalUnit.Pixel);
field = new FormTextField();
field.Name = "Address";
field.Bounds = new LogicalRectangle(196, 496, 892, 35,LogicalUnit.Pixel);

//Parse Results
foreach (FormsPage page in results.Pages)

foreach (FormsGroup group in page.Groups)
foreach (FormsMark mark in group.Marks)
string markString = String.Format("Mark {0}: {1}",

// Create a Searchable PDF
FormsRecognition FormsRecognition = new FormsRecognition();
PDFGenerator PDFGenerator = new PDFGenerator();
PDFGenerator.Save = @"C:\forms1.pdf";
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner