I get an XML or JSON with paths only, and I need to recreate the SVG image.
I create an empty
<svg xmlns='http://www.w3.org/2000/svg' version='1.1'></svg>
,
I add a <g transform="scale(1 -1)" fill='#aaa' stroke='black' stroke-width='5' ></g>
in it, and then in this element I add all of the paths in it (e.g. <path d=
... />
).
In the end I get a SVG image, but because I haven't set the viewBox attribute in the SVG element the image isn't properly displayed - when I open it in browser, a part of it is displayed full size.
Can the viewBox be calculated from the values from the paths?
Thank you!