桌面软件中的Onenote OCRfunction

是否有API使用Onenote OCRfunction自动识别图像中的文本?

如果您在程序执行的同一台计算机上安装OneNote客户端,则可以在OneNote中创建页面并通过COM API插入图像。 然后,您可以读取XML格式的页面,其中包括OCR的文本。

你想用

  1. Application.CreateNewPage创建一个页面
  2. Application.UpdatePageContent插入图像
  3. Application.GetPageContent读取页面内容并在XML中查找OCRDataOCRText元素。

此处记录了OneNote COM API: http : //msdn.microsoft.com/en-us/library/office/jj680120(v = office.15).aspx

当您通过API在OneNote中的页面上放置图像时,任何图像都将自动进行OCR。 然后,用户将能够在OneNote中搜索图像中的任何文本。 但是,此时无法将图像拉回并读取OCR文本。

如果这是您感兴趣的function,我邀请您访问我们的UserVoice网站并提交此想法: http : //onenote.uservoice.com/forums/245490-onenote-developers

更新:对该想法进行投票: https : //onenote.uservoice.com/forums/245490-onenote-developer-apis/suggestions/10671321-make-ocr-available-in-the-c-api

– 詹姆士

这里有一个非常好的示例如何: http : //www.journeyofcode.com/free-easy-ocr-c-using-onenote/

代码的主要部分是:

 private string RecognizeIntern(Image image) { this._page.Reload(); this._page.Clear(); this._page.AddImage(image); this._page.Save(); int total = 0; do { Thread.Sleep(PollInterval); this._page.Reload(); string result = this._page.ReadOcrText(); if (result != null) return result; } while (total++ < PollAttempts); return null; } 

不确定OCR,但onenote API的文档站点是这样的

http://msdn.microsoft.com/en-us/library/office/dn575425.aspx#sectionSection1