I have an svg image which I want to export as png.
In client side using javascript, I am converting it into base64
var s = new XMLSerializer().serializeToString(document.getElementById("svg"))
var encodedData = window.btoa(s);
In server side I want to decode it and create a .png file
BASE64Decoder decoder = new BASE64Decoder();
byte[] imageByte = decoder.decodeBuffer(string);
But this gives me a file which can't be opened.
Or is there any other way I can export the svg as png. I can't use toDataUrl since my svg contains images from external source