Interactive Ink

Iink Recognition

Hi,

Following the release of your new SDK we've decided to switch from the old SingleLineWidget to this.

First of all, i was wondering if i can (and how i can) get the recognized text outside the EditorUserControl? (let's say i want the text to be recognized and stored into a string.)
Even better if i could just get the recognized text outside the UC insted of having it override the Ink.

The possibility to get alternate candidates for the recognized text is still there?


Thanks for the support.


Dear Manuel,

thank you for contacting us.

Currently, the only way to get the word candidates is exporting the result in JIIX file.

You should proceed as follows:
-first, ensure you have an iink Editor properly initialized, such as in the code samples
-Create a content package: ContentPackage pkg = engine.createPackage(« myfile.iink »)
-Create a text content part: ContentPart part = pkg.createPart(« Text »)
-Set this part to the editor: Editor.setPart(part)
-Feed the editor with your ink using editor.pointerEvents(eventArray, false), where eventArray is your ink converted into pointer events (pointerDown, pointerMove+, pointerUp) and false means the gestures where deactivated
-wait for the recognition to end: editor.waitForIdle()
-export in JIIX format: editor.export_(MimeType.JIIX)

This JIIX file is basically a JSON file that will contain all word candidates with corresponding range.

Best regards,

Olivier
Dear Olivier,
Thanks for the support.

I have a few other questions:
I have an external device to write (a Smartpen, to be precise), i have a layout on paper with multiple fields and all of them are to be recognized as text.
I want to have a similiar behaviour into the iink sdk, so i tought:
A Text Document as a root block, to emulate the sheet, then multiple Text blocks inside in fixed positions to emulate the fields inside the sheet.

I saw that the editor.export_(block, type) let me chose wich block i want to export and that writing inside a Text Document creates a Text block automaticaly. I want to have a set number of Text blocks in fixed positions, so that i will write inside of a single block at a time and i can recognize only the block i want and not everything.
I noticed that i can't add Text blocks with empty data, nor i can set a desired width and height (seems to me it gets the whole document width and a line as height), how should i proceed?

Dear Manuel,

Indeed, it is not possible to create empty text blocks. Currently, the iink SDK behaves as the Nebo application, i.e. the textblocks are automatically created and destroyed., when the user writes or use break/join gestures.

I am afraid it is difficult to implement your use-case.

Best regards,

Olivier
Dear Olivier,

Isn't possibile to create Container blocks inside a Text Document, then pick the Text blocks inside the containers?
If there's a clean way to proceed, please let me know, right now i've solved with a workaround but i'm not satisfied by it.

Another quick question: it's possible to export the whole ink + background as an image?

Dear Manuel,

Currently, the content blocks are automatically created. We have an API that allows to get these but not to create these. I am afraid you will not be able  to proceed another way.

Regarding exporting, setting the proper MimeType to the export function, (we have the following ones: DOCX, GIF, GRAPHML, HTML, JIIX, JPEG, LATEX, MATHML, MUSICXML, PDF, PNG, PPTX, SVG, TEXT), you can export as an image, jjix (contains ink, and text result)... In your case, you will then have to call twice the export function (first time for image, second for jiix).

Best regards,

Olivier

Dear Olivier,
Thanks again for the support.
I will try some other ways in the near future, if i succeed without doing excessive workarounds i'll let you know.

Regarding exporting, i was using the UIReference for UWP, but i couldn't find the imageDrawer required to export, is that missing?

I'm in need to create a user lexicon with words given by the user at runtime, in details:
The user needs to be able to add new words each time it needs to in a lexicon (stored somewhere as a list of strings), i do not need for those new words to get recognized in the same session (but would be appreciated) but i do need to be able to update the old lexicon everytime a new word is added. My need is to not use the tool i think, is it possible?

Dear Manuel,

normally, the IImageDrawer is also present in UWP. You should ensure to implement the IImageDrawer class.

Regarding custom lexicons, it is not possible to create these on the fly with the iink.

You can only create lexicons "offline" using the tools and add these in your application.

Best regards,

Olivier

 Dear Olivier,

Is it possible to disable the gesture recognition?

Dear Manuel,

for such purpose, you should use the PointerEvents function, setting the processGestures boolean to false:

pointerEvents(PointerEvent[] events, boolean processGestures) 
Registers a list of pointer events.

You can find few topics that use this API:
-https://developer-support.myscript.com/support/discussions/topics/16000021050
-https://developer-support.myscript.com/support/discussions/topics/16000021288
-https://developer-support.myscript.com/support/discussions/topics/16000021290

Best regards,

Olivier
Login or Signup to post a comment