Replies: 1 comment 3 replies
-
I built the docs locally and I think I found what I need, namely: // Initialize the magic with:
const svgCanvas = new EmbeddedSVGEdit(window.frames.svgedit);
// Pass functions in this format:
svgCanvas.setSvgString('string');
// Or if a callback is needed:
svgCanvas.setSvgString('string')(function (data, error) {
if (error) {
// There was an error
} else {
// Handle data
}
}); The string is not encoded, and |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm incorporating svgedit into a react app, so we'll be using an iframe to embed svgedit, and postMessage to communicate with svgedit. Unfortunately, I've so far been unable to find the documentation I need to accomplish this. The jsdoc links in the README of this repo return 404. I've looked through the source code and I see a (very nice) API that wraps the postMessage details away via callbacks, but I haven't yet found what I need to pass to this API. I assume I need to pass the drawing to be opened as a (possibly encoded) string of some sort sent via an "open" message, and expect the updated drawing to be returned as a (possibly encoded) string in the call back of a "save" message. Provided this is correct, what exactly would this look like in practice? Thanks in advance for any help. Sorry if I missed these answers in a different set of documentation.
Beta Was this translation helpful? Give feedback.
All reactions