Search code examples
xmlmicrosoft-graph-apionenoteonenote-apiinkml

How to read InkML file to image or text using C#


I am trying to read handwritten text in onenote from the APIs provided by microsoft. I am able to get the handwritten text from onenote as inkML. Unfortunately I am unable to read from the inkML to image/text.Please suggest some solutions or links that can help me.

I need library or package that will help me with C#


Solution

  • The OneNote API supports getting InkML in beta: https://developer.microsoft.com/en-us/office/blogs/onenote-ink-beta-apis/

    The you can use InkMLJs to render it to a canvas: https://github.com/Microsoft/InkMLjs

    Once you have it in a canvas, you can export to an image 😊 How To Save Canvas As An Image With canvas.toDataURL()?

    As for the “extracting text” part… OneNote API does not support getting the ink analysis text from the OneNote page, so you'd have to run the analysis yourself via the coordinates in the InkML.