Get svg graphics size when width/height attributes on <svg> are not set

Viewed 20644

So how to get the size of an SVG file with javascript when width and height are not set on the svg element? The svg is a string, but could be made a DOM if necessary.

2 Answers

SVGs are scalable vector graphics, and thus can have any arbitrary height and width. Only the ratio is fixed by the format.

Related