I am a beginner in C#. I am trying to use tesseract.exe located as an independent application in Program files, which I have installed as a separate program. I want to use this .exe file to read clipboard image and then store the output in a windows form. All this needs to be done with a button click. My code is as follows:
- private void B8_Click(object sender, EventArgs e)
- {
- string ts = "C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe";
- m = Clipboard.GetImage();
- string lang = "eng";
- if (m != null)
- {
- Process w = new Process();
- w.StartInfo.UseShellExecute = false;
- w.StartInfo.FileName = ts;
- w.StartInfo.Arguments = string.Format("\"{0}\" \"{1}\" -l {2}", m, v, lang);
- w.Start();
- w.Close();
- tb5.AppendText(v + Environment.NewLine);
- Clipboard.Clear();
- m = null;
- v = null;
- }
- else
- {
- MessageBox.Show("No Image.");
- }
This gives nothing in textbox. Thanks in advance.