General questions

Answered

Multiple user support, conversion font size

Hey,

So this is really cool :)

I have a few questions, apologies for putting them here, I know that tends to be bad practice, but I imagined that they are all reasonably straight forward to answer :(

I'm building a web app (js library) using the math interpreter and all is working nicely. What I would like is a user to also be on the same page from another device, also able to see the maths being written on the original device. My suspicions tell me that there will be a way to send the data that the user is writing on device one over a custom web socket to anyone listenting. I think from the documentation, I could export the data some how in real time and send it over the socket, then import it the other end in a similar manner. What's the best import/export approach I should take here? Note, the second user doesn't need to be able to change it.


When I convert the font, how do I set the size of the resulting conversion? I saw that there is a `.math {...}` css class, but I wasn't able to make any adjustments using this. Tips helpful.


Final question. Please could you point me in the direction to instructions on exporting as an image/svg I couldn't find one, but I keep reading about it. Thanks!!


Best Answer

Dear Alex,


Thank you for the feedback.

Using MyScriptJS, 

editor.eastereggs.importStrokeGroups(editor, strogeGroups)

is also a good way to import strokes into another canvas.


https://github.com/MyScript/web-integration-samples/blob/28fa984d050d1dfda5d97ceb9ad2d8e038b9359a/batch-mode-explorer/src/views/Write.vue


Regards,


Maël


Dear Alex,


1. From what i can see, you would be able to call the _export method to get a JIIX, store it somewhere (in your database for example) and retrieve it from another client calling the _import method.

I link you the page from the documentation : https://developer.myscript.com/docs/interactive-ink/1.3/web/myscriptjs/import-and-export/#importing-content

There is also a code sample using the JIIX import in the MyScriptJS GitHub repository : https://github.com/MyScript/MyScriptJS/blob/master/examples/v4/import_math_jiix.html


2. You can update the size of the pen  globally by setting the penStyle property : 

editorElement.editor.penStyle = {'-myscript-pen-width': 4};


3. You can find a documentation to import/export here : https://developer.myscript.com/docs/interactive-ink/1.3/overview/import-and-export-formats/#available-exports

And a code sample here : https://github.com/MyScript/MyScriptJS/blob/master/examples/v4/file_export.html


I hope this will be useful.


Regards,


Maël

This is great thanks, I've got exporting working thats awesome.

I've also got the pointer events exporting which I am sending to a server and saving as PNG. This is all working great, I used this example to understand how to get the pointer events: https://myscript.github.io/web-integration-samples/batch-mode-explorer/dist/#/write

However when I render the pointer positions on a canvas with JS, I lose all the 'smoothness' that i can see in the myscript canvas. See pictures below (pink one is an HTML canvas).

image

image


Its the same pointer events, but without the smoothness. Is there "more information" I can extract that will give me the smoothness? Note, I don't want to generate the PNG from myscript, because I am sending the pointer events in real time, so that I can render the images as the 'writer' writes, not once they have finished (creating a history of images of what the writer wrote, rather than just the finished product

Thanks

Alex

FYI I solved the smoothing issue with paper.js if anyone is interested

Answer

Dear Alex,


Thank you for the feedback.

Using MyScriptJS, 

editor.eastereggs.importStrokeGroups(editor, strogeGroups)

is also a good way to import strokes into another canvas.


https://github.com/MyScript/web-integration-samples/blob/28fa984d050d1dfda5d97ceb9ad2d8e038b9359a/batch-mode-explorer/src/views/Write.vue


Regards,


Maël