Cómo puedo convertir un elemento SVG a un archivo PNG o JPG y luego puedo enviar un archivo PNG o JPG al servidor. Creo un elemento SVG como este:
var xmls = "http://www.w3.org/2000/svg"; var svgElem = document.createElementNS(xmls,"svg"); svgElem.setAttributeNS(null,"viewBox","0 0 200 200"); svgElem.setAttributeNS(null,"width","200"); svgElem.setAttributeNS(null,"height","200"); svgElem.style.backgroundImage = "url(imageUrl)";Cómo puedo convertirlo a PNG o JPG y enviarlo como un archivo