TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ambrish dhaka
NA
4
1.6k
Tesseract usage in C#
Jul 27 2019 5:08 AM
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.
Reply
Answers (
5
)
How can i solve this Issue in windowsform?
web browser get search history in data table c#