C# OCR Library
Quick to Start with Tiff Image Text Extraction


Help C# User Have Quick Evaluation of .NET OCR SDK, Providing Simple Sample Code to Extract Text from a Tiff File

On this tutorial, we provide free Visual C# programming code for testing the functionality of text extraction from raster image Tiff. You may directly copy demo code below to your C#.NET project to have a quick evaluation of our XImage.OCR for .NET. At the very beginning, you may install .NET OCR SDK DLLs into your Visual Studio C# project as references. Please note that, for Tiff image text extraction, RasterEdge.Imaging.TIFF.dll should also be added as project reference.



Related .net document control helps:
asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net word document viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net document viewer control: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net dicom library: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net sharepoint document viewer control: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint





C# Sample Code to Extract Text from Tiff Image File



By using well developed .NET APIs, C# programmers are able to extract and recognize Tiff image file characters. Both single page Tiff image and multi-page Tiff image are supported by our OCR Toolkit for C#.NET. And the following free code example is available for these two forms. As you see, you can choose to load a certain page of Tiff image file and get its text. After recognition, OCR result can be saved and output as text, PDF and SVG files.

// Set the training data path. Please put eng.traineddata (for English) under the path specified.
OCRHandler.SetTrainResourcePath(@"c:\source");

// Set supported language. You can also set this attribute in OCRPage or OCRZone.
OCRHandler.Settings.LanguagesEnabled.Add(Language.Fra);

// Load Tiff image file.
TIFFDocument doc = new TIFFDocument(@"c:\sample.tif");

// Load the first page to recongnize.
TIFFPage page = (TIFFPage)doc.GetPage(0);

// Rasterize the page with a resolution multipi.
Bitmap bmp =  page.GetBitmap(1.5f);

// Import the page to recoginze.
OCRPage oPage = OCRHandler.Import(bmp);
oPage.Recognize();

// Save OCR result as a supportive documet format (Txt, PDF and SVG).
oPage.SaveTo(MIMEType.TXT,@"c:\sample.txt");

// Or you can output the text directly.
Console.WriteLine(oPage.GetText());




More C# Demos for Using OCR Software



If you need to use OCR technology to recognize and extract text content from other supportive image and document formats, please directly refer to More C# Demos for Image File Text Extraction.