Guide for C#
Core Document Formats
Additional Features

C# Imaging - Form Processing & Recognition in C#

Visual C# Codes for Form Identification & Processing with .NET Imaging SDK

Visual C#
Home > .NET Imaging SDK > C# > Form Processing
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

RasterEdge .NET Imaging SDK is a mature image processing toolkit with multiple image & document manipulation DLL libraries, including this form processing plug-in component. This component enables .NET developers to build powerful application for template / form processing, such as form scanning & recognition, form image cleanup, form alignment, OCR, OMR, and many other features. We provide fully-functional evaluation package, please download now to enjoy the wonderful form processing features!
Related .net document control helps: open pdf password: ASP.NET PDF Password Edit Control: online add, remove, update PDF file open password using C# pdf file permission: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C# sharepoint pdf editor: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites
file redact Redact document ASP.NET: add, delete, apply redaction on PDF files in web browser using edit pdf page control: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C# redact pdf control: ASP.NET Redact PDF Document Control: redact, remove PDF text, images in web browser using C# ASP.NET dicom file viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
  • Scanning forms on the image or document for recognition in C# project
  • Provide advanced features to clean up and enhance forms quality with C# codes
  • Identify and align forms using Visual C# programming language
  • Drop out and extract zones for later data processing
  • Compiling C# to detect OCR, ICR and OMR in C#
  • Easy to decode / read various linear and 2D barcodes like Code 39, QR Code, etc
  • Using C# demo codes to save form recognition results
  • Offer sample application with C# source code for more form recognition and processing functions
This page is a simple guide demonstrating how to identify and process forms in a C# imaging project. The following sections will be mentioned in the later demonstration:
  • How to build a C# form processing application
  • How to load a form in C# project
  • How to identify and align form using C#
  • More Visual C# tutorials and sample codes for image and doc editing
Besides this form processing feature, you can also opt for other RasterEdge add-on SDK to add more flexible functions. For example, we also provide this .NET Barcode Generator and Barcode Reader control libraries so you can write or scan barcodes in your forms. You can also take a look at this C#.NET image SDK programming for image manipulation such as jpeg / gif / png / tiff image generation, editing, annotating, converting, saving and printing in your forms.
Build a C# Application for Form Processing and Recognition
This page tells users how to detect / recognize, process and save form with RasterEdge .NET Imaging SDK and Template Processing Plug-In in Visual C# project. (For VB.NET developers, please go to Form Processing for VB.NET. If you are building applications for .NET WinForms or ASP.NET Web project, please go to Template Recognition in WinForms and Web Document Form Processing & Recognition.)
  1. Run Microsoft Visual Studio (2005 to 2012 versions supported);
  2. Create a project with programming language - Visual C#;
  3. Activate license for .NET Imaging SDK and copy created "RasterEdgeLicense.txt" to the new project folder, together with .NET Imaging SDK DLL(s);
  4. Add RasterEdge DocImageSDK core dlls & RasterEdge.Imaging.Form.dll to your Visual C# applications;
  5. Call RasterEdge .NET Image SDK Namespace with the samples demonstrated below:
using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Processing;
using RasterEdge.Imaging.Form.Processing;
using RasterEdge.Imaging.Form.Recognition;
Load Form in C#.NET Codes
The following C# sample code shows how to load a form to your Visual C# project for form processing & identification. Please copy to your program for evaluation. You can make necessary change to the settings like text field name, form page, and so on, to get a form which meets your requirements better.
FormProcessingEngine processingEngine = new FormProcessingEngine();

FormPage formPage = new FormPage(2, 100, 100);
TextFormField textField = new TextFormField();
textField.Name ="Business Name";
textField.Bounds = new LogicalRectangle(196,327, 1402, 40, LogicalUnit.Pixel);
textField = new TextFormField();
textField.Name = "Address";
textField.Bounds = new LogicalRectangle(196, 496, 892, 35,LogicalUnit.Pixel);

private void ProcessForm(RasterImage image,List<PageAlignment> alignment)
processingEngine.OcrEngine= formsOCREngine;
string resultsMessage = String.Empty;
processingEngine.Process(image, alignment);
foreach(FormPage formPage in processingEngine.Pages)
foreach(FormField field in formPage)
if (field != null)
resultsMessage = String.Format("{0}{1} = {2}{3}",
(field.Result as TextFormFieldResult).Text,
catch (Exception ex)
if (String.IsNullOrEmpty(resultsMessage))
MessageBox.Show("No fields were processed", "FieldProcessing Results");
MessageBox.Show(resultsMessage, "Field ProcessingResults");
Identify and Align Form in C#.NET
The Visual C# code below demonstrates how to identify and align form or template in a C# application. Copy and paste the C# codings to your program to easily recognize incoming scanned forms from your form library, and align it for later processing. When this is done, users can feel free to conduct further form processing actions such as form registration, form drop out, form field / zone extraction, as well as OCR / OMR / ICR processing.
RasterEdgeImage sourceImage = new RasterEdgeImage(@"C:\temp\sourceImage.tif");
RasterEdgeImage targetImage = new RasterEdgeImage(@"C:\temp\targetImage.tif");
PageFingerprintGenerator generator = new PageFingerprintGenerator();
PageFingerprint sourceFingerprint = generator.GenerateFingerprint(sourceImage);
PageFingerprint targetFingerprint = generator.GenerateFingerprint(targetImage);
DocumentAligner aligner = new DocumentAligner();
AlignmentResult result = aligner.Align(sourceFingerprint, targetFingerprint);
AlignmentRejector rejector = new AlignmentRejector();
More Tutorials!
Find more user guides with RasteEdge .NET Image SDK using Visual C# sample codings!

Recommend this to Google+ is professional provider of document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster