iink SDK Web

Answered

Re-importing strokes using pointerEvents when using protocol REST

I am trying to enable users to re-import text they have previously written. With the help of the WebSocket Pointer Events example and this thread on the forum I was able to achieve that using the WebSockets protocol by:


1. setting recognitionParams.iink.jiix.strokes to true in the editor configuration,

2. on export reading exports["application/vnd.myscript.jiix"] 

3. converting that into the format required by PointerEvents as outlined by Gwaenelle here

4. then handing that to the editor editorElement.editor.pointerEvents(pEvents, false);


and it works fine with WebSockets. However, I am trying to rebuild all of this with procotol REST now as pointed out here


Unfortunately, assigning the the exact same pointerEvents to the editor registered with protocol REST (but basically everything else staying the same as with WebSockets) I get the following error:

image

Is this a feature only available with WebSockets? Is there any way to achieve re-importing strokes into an editor with REST protocol? 


Best Answer

Dear Brhempen,


thank you for the update.


Currently, the REST API doesn't allow to import a previously exported JIIX file.


The solution is that you re-create a REST request, to which you provide the previously exported coordinates.


Nevertheless, please note the coordinates are in millimeters, while the REST request uses pixels. You shall then convert the coordinates of the JIIX to pixels.


Best regards,


Olivier

1 Comment

Answer

Dear Brhempen,


thank you for the update.


Currently, the REST API doesn't allow to import a previously exported JIIX file.


The solution is that you re-create a REST request, to which you provide the previously exported coordinates.


Nevertheless, please note the coordinates are in millimeters, while the REST request uses pixels. You shall then convert the coordinates of the JIIX to pixels.


Best regards,


Olivier