Migrate from 1.2
This page lists the key points to pay attention to when migrating existing code from iink SDK 1.2 to the new iink SDK 1.3.
The JIIX format has been updated to version 2. This allowed the inclusion of style and decoration information and made possible math JIIX import by iink SDK. If you were parsing JIIX output, you will have to update your parser code to follow the (small) evolutions that came with this new version.
➤ JIIX reference (updated to version 2)
While the original JIIX specification did not contain any versioning information, a new “version” key has been added to the root JSON object. It has a string value (currently “2”) identifying the iteration of the format.
strokesarray has been replaced by an
itemsarray gathering strokes, glyphs and shape primitives.
- For drawing blocks, a new
spansarray has been added to store the style when available under the form of “span” objects referencing ranges of items.
- For text blocks, a new
spansarray has been added to store the style when available under the form of “span” objects referencing ranges of characters.
styleproperties were added to math and diagram nodes.
rangeproperty that was associated to ink in all blocks have been removed.
- All blocks now have an
export.jiix.styleconfiguration key to
truefor style information to be exported to JIIX. Also note that only dynamic style, pen style classes and styling applied with decorations will be exported. Editor-level stylesheet will not.
Starting with iink SDK 1.3, it is no longer possible to directly import batches of pointer events in “Text Document” parts. This change was motivated by the fact that it is difficult to get the ink properly aligned on the guides to get good recognition results.
Should you want to achieve a similar behavior, you are now encouraged to:
- Send each batch of pointer events to a dedicated “Text”, “Math”, “Diagram” or “Drawing” part depending on the type of the content you want to process. Remember to disable the guides on “Text” parts if you cannot ensure that they will match the baselines of the ink words.
waitForIdle()to ensure that the recognition is complete.
- Paste as a block into your “Text Document” part at the appropriate location.