0

I have a method:

line.prototype.exportSVG = function() {
    return this.getrdlineElements().map(function(element) {
        return element.exportSVG();
    });
}

this method returns an array of SVG shapes example [rect, path, ellipse]

Instead of returning the elements in an array i want to return these as a string (xml) and in another function (importSVG) i will use this string data to create an svg image file.

how can i do this?

thanks in advance :)

  • What are `[rect, path, ellipse]`? SVGElements? Here you'l find out how to create and download a standalone svg inside this [Answer](https://stackoverflow.com/questions/38477972/javascript-save-svg-element-to-file-on-disk/38481556#38481556), just read the exportSVG function, you can remove the parseStyles part and don't need to create a clone. – Kaiido Nov 06 '17 at 02:59
  • Please create a [mcve] so we can properly see what you are trying to do. – Paul LeBeau Nov 06 '17 at 09:03

0 Answers0