Hello,
Thank you for your update.
The Web Editor does not support import_ with application/vnd.myscript.iink, it only support raw data import.
You can refer to this iinkTS example that illustrates how to import raw data with Diagram REST API:
https://myscript.github.io/iinkTS/examples/rest/rest_diagram_iink_import.html
https://github.com/MyScript/iinkTS/blob/master/examples/rest/rest_diagram_iink_import.html
in your case, instead of using the strokes from the ../assets/datas/diagram-pointers-2.json file as in the example, you need to use the strokes from your .jiix exported file.
Please note that the .jiix files strokes coordinates are in mm, while the editor importPointEvents expects pixels coordinates, so you must convert the strokes coordinates.
This topics on the forum describes this system coordinates conversion step:
https://developer-support.myscript.com/support/discussions/topics/16000029254
Please also note, that for interactive use, we recommend you to use a Raw Content with Web Socket mode, rather than a Diagram with REST mode.
As you are starting a new project, we suggest you to take a look at our Interactive Ink Editor example:
Best regards,
Gwenaëlle
Dear Gwenaëlle,
Thank you for the clarification.
To answer your question — we are using iinkTS along with MyScript Web SDK to allow users to draw diagrams directly in the browser. Our current setup uses the web-based editor provided in the iink Web demo (integrated into our ASP.NET Core application).
We are saving both:
rawInkData (from the model.export method)
JIIXData (for display/reference)
Our main goal is to allow users to reopen and continue editing a previously saved diagram from the browser.
From your reply, it appears that:
The Diagram content part is only available for batch REST processing
And it is not possible to re-import strokes (rawInkData or JIIX) into the editor to enable further editing
Given this limitation, could you kindly advise:
Is there any supported way to persist and re-edit Diagram content in a web environment?
Would the only viable solution be to move to the native SDK to achieve this feature?
If not possible on the web, could we simulate this by storing packages or strokes externally and feeding them back to the editor somehow?
We appreciate your guidance and want to align with best practices for the Web SDK.
Code to load data for re-edit
window.addEventListener('load', async () => {
const rawInkData = @Html.Raw(Json.Serialize(Model.rawInkData ?? "null"));
console.log("Raw Ink Data from Model:", rawInkData);
await editorElement.editor.import_(rawInkData, "application/vnd.myscript.iink");
if (rawInkData && rawInkData !== "null") {
try
{
const rawInkJSON = JSON.parse(rawInkData);
console.log("Parsed Raw Ink Data:", rawInkJSON);
// Wait for the editor to import the data
if (editorElement && editorElement.editor && typeof editorElement.editor.import_ === 'function') {
console.log("Editor is initialized. Attempting to import raw ink data...");
try {
const importResult = await editorElement.editor.import_('application/vnd.myscript.iink', rawInkJSON);
console.log("Import Result:", importResult);
if (importResult) {
console.log("Import successful. Restoring diagram...");
editorElement.editor.resize();
editorElement.editor.render();
} else {
console.error("Import failed: import_ result is undefined or falsy.");
}
} catch (err) {
console.error("Import failed:", err);
}
} else {
console.error("Editor or import method is not available.");
}
} catch (err) {
console.error("Error parsing rawInkData:", err);
}
} else {
console.error("No raw ink data available or data is invalid.");
}
});
Hello,
With MyScript Web SDK APIs, the Diagram content part is only supported by the REST batch endpoint. In such case, the iink backend server does not persist the .iink file, so there is no API to import the strokes from a JIIX file, and be able to edit it later on.
Which Web Editor are you using? Are you using iinkTS for drawing your diagrams or do you have your own canvas?
Best regards,
Gwenaëlle
Dear Gwenaëlle,
Thank you for your prompt response and for the clarification provided.
To confirm, we are using the MyScript Web SDK, not the native version. Our use case involves allowing users to draw diagrams in the Web Editor, save their work (in JIIX/raw format), and later re-open those diagrams for further editing via the browser.
As you've mentioned, the default JIIX import action for diagrams in the Web SDK only updates the text candidate rather than re-importing the full raw data. This likely explains the issue we’re facing — the import_() function is not restoring the previously saved content as expected.
We would appreciate your help with the following:
How can we configure the diagram.import.jiix.action in the Web SDK to allow full raw diagram import (not just updating a label or candidate)?
If there are specific editor configuration settings or examples available to support this use case in the Web SDK, could you kindly share those?
We’ve reviewed the native documentation you linked, and while it is helpful conceptually, we would need equivalent guidance specific to the Web SDK setup.
Our objective is to enable end users to continue working on a previously saved diagram using the web interface.
Thank you again for your support — we’re eager to implement the correct approach.
Hello
Thank you for contacting us.
We are not sure if you want to use our native or web APIs.
Since you are referring to the Editor, we assume you mean the native Editor. To easily reedit your diagram later, we recommend saving your package so you can reopen it, rather than using export and import functions.
For more details, please refer to https://developer.myscript.com/docs/interactive-ink/4.1/windows/fundamentals/storage/#creating-and-loading-packages
If you need to export and reimport JIIX diagram data for a specific use case, the error you are experiencing is most likely due to the default JIIX import action for diagrams:
By default the JIIX import action for Diagram updates a text candidate rather than importing raw data. Therefore, you must update the diagram.import.jiix.action configuration, to achieve your desired result.
See https://developer.myscript.com/docs/interactive-ink/4.1/windows/fundamentals/import-and-export/#jiix-import-into-diagram-and-raw-content-parts
Best regards,
Gwenaëlle
Abhayk. 147
Dear,
I hope you're doing well.
I'm writing to seek your assistance regarding a technical challenge we're facing with the MyScript Web SDK integration in our ASP.NET MVC Core application. Specifically, we are attempting to import previously saved diagram data into the MyScript Editor, allowing users to re-edit existing diagrams.
Background:
We are using the MyScript Editor to capture and store diagrams created by users. Upon saving, we export the content in JIIX format (also referred to as rawInkData) and store it in our backend database.
When users return to edit a saved diagram, we retrieve this rawInkData and attempt to re-import it into the editor using the SDK’s import_() method.
❗ Issue:
While:
The rawInkData is correctly retrieved from our backend,
The editor is fully initialized,
And the import_() method is available and invoked properly,
The import fails silently. The import_() call does not return a result and the editor does not render any of the previously saved diagram content. No specific error message is returned — we simply receive an undefined or falsy response.
❓ Request for Clarification:
We would greatly appreciate your guidance on the following points:
Is it possible to import previously exported JIIX or rawInkData back into the editor using import_()?
If yes, what is the expected format or MIME type of the data to make the import work correctly?
Are there limitations with JIIX data being used directly for imports?
Can you provide an example or recommended method for restoring and editing previously saved diagrams?
Our goal is to allow users to edit their previously created diagrams seamlessly, but we are currently blocked by the inability to re-import saved content.
Please let us know if you require any further information or a sample project to assist with troubleshooting.
Thank you very much for your time and support.