Cloud Development Kit

MyScriptJS - How to load JIIX data?

Hi, I'm developing a web service with MyScript v4.

From the API reference and examples, I was able to save my handwriting as a JIIX.

Then, how can I load the JIIX data into MyScript Editor?

editor.importContent({x:0,y:0},jiixdata,"application/vnd.myscript.jiix") doesn't work for me (Editor.js:155 Error while firing the recognition {type: "error", message: "mime type must be textfor a textcontent part"}). 

  

var jiix="{
 "type": "Text",
 "bounding-box": {
  "x": 117.53333,
  "y": 60.647915,
  "width": 17.345833,
  "height": 21.314587
 },
 "label": "ㅿ",
 "words": [ {
   "label": "ㅿ",
   "bounding-box": {
    "x": 117.53333,
    "y": 60.647915,
    "width": 17.345833,
    "height": 21.314587
   },
   "candidates": [ "ㅿ", "△", "O", "0", "o" ],
   "range": "[0:0,0:48$]",
   "strokes": [ {
     "timestamp": "2017-11-20 16:08:16.263000",
     "X": [ 126.20625, 124.88333, 124.35416, 123.29583, 122.50208, 121.17916, 120.38541, 119.85625,
      119.0625, 118.79791, 118.79791, 118.53333, 118.53333, 118.53333, 118.53333, 118.79791,
      119.59166, 120.64999, 121.97292, 122.76666, 123.56041, 124.61874, 125.4125, 126.73541,
      128.32291, 129.11667, 129.91042, 130.96875, 131.7625, 132.82083, 133.61458, 133.87917,
      133.87917, 133.87917, 133.87917, 133.34999, 132.82083, 132.55624, 132.02708, 131.7625,
      131.49791, 131.23332, 130.96875, 130.175, 129.11667, 128.32291, 127.26458, 126.47083,
      125.67708 ],
     "Y": [ 61.647915, 63.235416, 64.558334, 66.145828, 67.46875, 69.585411, 70.908333, 72.495834,
      74.083328, 74.877083, 75.67083, 76.464584, 77.258331, 78.052078, 78.845833, 79.63958,
      80.433334, 80.962502, 80.962502, 80.962502, 80.962502, 80.962502, 80.962502, 80.697914,
      80.168747, 79.63958, 79.375, 78.845833, 78.316666, 78.052078, 77.522911, 76.729164,
      75.935417, 75.141663, 74.347916, 73.025002, 71.966667, 70.643745, 69.320831, 68.527084,
      67.73333, 66.939583, 66.145828, 65.881248, 65.352081, 65.087502, 65.087502, 65.087502,
      64.822914 ],
     "F": [ 0.5, 0.72053176, 0.75311285, 0.78808492, 0.76302224, 0.81546116, 0.76302224, 0.77287984,
      0.77982491, 0.68318993, 0.6761536, 0.68318993, 0.6761536, 0.6761536, 0.6761536, 0.68318993,
      0.72229666, 0.72921258, 0.74367464, 0.6761536, 0.6761536, 0.71451586, 0.6761536, 0.74618471,
      0.77287984, 0.70071042, 0.68318993, 0.72921258, 0.70071042, 0.71852648, 0.70071042, 0.68318993,
      0.6761536, 0.6761536, 0.6761536, 0.75311285, 0.72921258, 0.74618471, 0.75311285, 0.68318993,
      0.68318993, 0.68318993, 0.68318993, 0.68318993, 0.72921258, 0.68318993, 0.71451586, 0.6761536,
      0.68318993 ],
     "T": [ 0, 268, 284, 300, 317, 335, 351, 367,
      384, 401, 417, 434, 451, 468, 484, 519,
      552, 585, 602, 618, 635, 669, 702, 735,
      768, 785, 802, 818, 835, 868, 918, 1001,
      1034, 1051, 1067, 1084, 1101, 1117, 1134, 1151,
      1170, 1201, 1251, 1300, 1367, 1401, 1434, 1468,
      1535 ],
     "id": "0000000001006100ff00"
    } ]
  } ]
}"

 

 




Dear Sir,

currently, here are the current limits to import JIIX data, and how you should import JIIX:

### JIIX import

JIIX import is so far limited to text words candidate changes. More import capabilities will be provided later on.

To change the text candidates within a given Text or Diagram block:

1. Export the block to the JIIX format.
2. Replace the `label` of the target `word` with another word **from the `candidates` list**.
3. Import the modified JIIX data back to your block.

Important : Importing JIIX data is only possible if the target block was not modified since it was exported.


Best regards,

Olivier

1 person likes this
Dear Sir,

currently, we found a bug on our servers... it has normally been fixed.

You should then be able to import a jiix fileas long as you respect the above limitation.

Best regards,

Olivier
Login or Signup to post a comment