I am trying to create a svg file from some existing svg elements.
`
Code:BR 4001, Size:X
LCode:BR 4001, Size:X
L
This is the structure of the elements. I am holding this as a string in a variable named "elements" and trying to create a svg file as follows:
const { createSVGWindow } = require('svgdom')
const window = createSVGWindow()
const document = window.document
const { SVG, registerWindow } = require('@svgdotjs/svg.js')
// register window and document
registerWindow(window, document);
const svgFromString = (string) => {
const draw = SVG(document.documentElement);
var svg = draw.svg(string);
return svg;
};
var newsvg = svgFromString(elements)
`
I am getting this error: Unbound namespace prefix: "svgjs" on the last line. I am able to create svg this way with similar files, but getting error on these specific svg files, from where the elements were taken.
[https://drive.google.com/file/d/1sxDc1-XsB0cip575btGCG6yHw7VNuZqy/view](here is svg file I'm working with)
I am trying to create a svg file from some existing svg elements. `
This is the structure of the elements. I am holding this as a string in a variable named "elements" and trying to create a svg file as follows:
const { createSVGWindow } = require('svgdom') const window = createSVGWindow() const document = window.document const { SVG, registerWindow } = require('@svgdotjs/svg.js')// register window and document registerWindow(window, document);
const svgFromString = (string) => {
}; var newsvg = svgFromString(elements) ` I am getting this error: Unbound namespace prefix: "svgjs" on the last line. I am able to create svg this way with similar files, but getting error on these specific svg files, from where the elements were taken. [https://drive.google.com/file/d/1sxDc1-XsB0cip575btGCG6yHw7VNuZqy/view](here is svg file I'm working with)