Dheerendra Dwivedi

Dheerendra Dwivedi

  • 1.6k
  • 107
  • 4.5k

how to convert tiff image to txt file

Apr 12 2013 2:09 AM
How to convert tiff image to

OCR running error


I want to convert tiff to txt file,but error is occur

richTextBox1.Text = string.Empty;
MODI.Document doc1 = new MODI.Document();

doc1.Create("C:\\Users\\Dhirendra\\Desktop\\file con\\images_3_.tiff");


doc1.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true,true);---Ocr erroor Here
string strText = String.Empty;
MODI.Image img = (MODI.Image)doc1.Images[0];
MODI.Layout layout = img.Layout;

for (int i = 0; i < layout.Words.Count; i++)
{
MODI.Word word = (MODI.Word)layout.Words[i];

if (extractedText.Length > 0)
{
extractedText += " ";
}

extractedText += word.Text;
richTextBox1.Text = extractedText;
// File.Delete("C:\\Users\\Dhirendra\\Desktop\\file con\\Raster_and_Vector.tiff");
}
layout = null;
img = null; // !!!
doc1.Close(false);
doc1 = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();

//textBox1.Text = strText;
richTextBox1.Text = strText;
File.Delete("C:\\Users\\Dhirendra\\Desktop\\file con\\images_3_.tiff");



Answers (7)