private string ocrIMG(string imgf, OneNoteOCR eng) { string rs = ""; var text = eng.RecognizeImage(imgf); if (text != null) { rs = text; } return(rs); }
static void Main(string[] args) { var ocr = new OneNoteOCR(); try { ocr.Verify(); } catch (Exception) { Console.WriteLine("you do not have OneNote 15 "); return; } if (args.Length == 0) { Console.WriteLine("please add argument = path to the image file"); return; } var ocrText = ocr.RecognizeImage(args[0]); Console.WriteLine(ocrText); }