Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# .NET
How to Convert .tif file to .txt file in Windows application(.Net(C#))
Posted 4-Apr-13 20:59pm
Sandeep Mewara at 5-Apr-13 2:06am
Tried anything so far?
Prasad Khandekar at 5-Apr-13 2:46am
Hello Dheerendra,
Why not use any OCR software?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Path.ChangeExtension can be used to change the extention of Path string
String filePath = "E:\\WindowsPractice\\Class1.tif";
Path.ChangeExtension(filePath, ".txt");

To change the extention of the file physically:

File.Move(filePath, Path.ChangeExtension(filePath, ".txt"));
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hello Dheerendra,
Here is a small snippet based on ASPOSE OCR SDK.
//Create OcrEngine instance and assign image, language and image configuration
OcrEngine ocr = new OcrEngine();
ocr.Image = ImageStream.FromFile("YOUR IMAGE PATH");
ocr.Config.NeedRotationCorrection = chkRotation.Checked;
ocr.Config.UseDefaultDictionaries = true;
//Set resource file name and extract OCR text
using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open)) {
    if (ocr.Process()) {
        strText = ocr.Text.ToString();
A more complete sample can be found on ASPOSE web site[^]. There is a freeware wrapper[^] available for Tesseract[^] OCR Library as well. Another alternative is to use MODI which is part of Microsoft Office.
Dheerendra Dwivedi at 8-Apr-13 8:08am
But how to Add OcrEngin in my Application
Prasad Khandekar at 8-Apr-13 8:42am
First you need to purchase ASPOSE OCR SDK or dowload the trial version. The link is given in the solution. Next you have to add reference to the Aspose OCR assembly.
1. Right-click the project's References node and select Add Reference from the menu.
2. In the Add Reference dialog, select the .NET tab
3. If you used an MSI installer to install Aspose.OCR, Aspose.OCR is listed in the top pane. Select Aspose.OCR and then click Select
4. If you downloaded and unpacked the DLL only, locate the Aspose.OCR.dll file using the Browse button
The getting started guide for Aspose.OCR Sdk is available here (
Dheerendra Dwivedi at 11-Apr-13 7:13am
mdoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, True, True)is giive me OCR Error
Prasad Khandekar at 11-Apr-13 8:00am
What's the error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 424
1 OriginalGriff 375
2 CHill60 230
3 CPallini 220
4 Maciej Los 210
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 5 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100