Replies: 2 comments
-
SVG-Edit currently expects an SVG namespace declaration--it must be well-formed XML which is valid SVG. Try this: canvas.importSvgString(
'<svg xmlns="http://www.w3.org/2000/svg"><text x="50" y="50" fill="red">text</text></svg>'
); |
Beta Was this translation helpful? Give feedback.
0 replies
-
yep, much better like this, thank you ++. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use canvas.importSvgSgtring to add dynamically svg to existing canvas. Svg is added as can be seen into SVG code, but canvas is not refreshed. I have to open svg code editor and close to force refresh.
Using svg-editor.html
Canvas is not refreshed, but SVG code is ok.
$('iframe.svgedit')[0].contentWindow.svgEditor.canvas.getSvgString();
Contains updated SVG with new text.
Canvas shall be refreshed with new SVG added.
SVG-Edit environment
Desktop:
Beta Was this translation helpful? Give feedback.
All reactions