This page drives you through available possibilities to import content into iink SDK or to export it for external usage.
You can import data into your iinkTS instance.
For example, the following code will import the “Hello iink SDK” text string into a “Text” part:
editor.import_("Hello iink SDK", "text/plain");
Managed formats are depending on the recognition type of your input.
Currently, MATH
supports only JIIX import.
const jiix = "..."; // string containing the jiix definition
mathComponent.import_(jiix, 'application/vnd.myscript.jiix');
You can import plain/text data in TEXT
.
JIIX import in TEXT
is so far limited to text words or characters candidate changes. More import capabilities will be provided later on.
To change the text candidates within a given Text :
label
of the target word
(or character
) with another word (or character) from the candidates
list.TEXT
is only possible if the target block was not modified since it was exported. For more information, refer to this page.
To import raw ink pointer events, instantiate an editor and pass it an array of pointer events. Note that in this scenario, according to recognition and classification configurations, the recognition engine will automatically process the new strokes. This approach is documented in the Editing part of this guide.
By default, an exported
event is fired every time some content is recognized on the server side.
The event is shaped like in the example below.
{
detail : {
rawResult : {
type:"exported",
partId:"xdyygiil",
exports:{"text/plain":"mycontent"}
}
}
...
}
If you want to override the default behavior and if you are willing to export “on demand” (by calling the export_()
method),
you have to set
the ondemand
attribute to your iinkTS
tag.
You can also configure the default exported mime-types by setting in JavaScript the configuration
attribute with the mime types you want to export in an array at
path recognitionParams.iink.math.mimeTypes
for MATH or recognitionParams.iink.text.mimeTypes
for TEXT. The export mime-types depends on the type of content part
you have configured.
If you’re using the REST mode, note that only one mime-type will be use per call. However, we will proceed to call the server for each mime-type specified.
MyScript iink SDK defines its own format, called JIIX (short for JSON Interactive Ink eXchange format).
This format provides a consistent representation of the different types of content that are supported, covering semantics, positions, styling and ink-related aspects.
Thanks to its JSON syntax, it stays readable and can be easily parsed, making it appropriate to exchange information with the host application or as a transitory representation to support custom export formats.
MyScript iink SDK allows you to import and export some commonly used formats, such as LaTeX for math content or Docx in the case of Text Document blocks.
The full list can be found here.