You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a data-uri as xlink:href, I am able to render/return an svg, which I can convert to png successfully using convert in shell. But when calling render the image disappears, with apparently no errors.
var svg = ' \
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100" height="100"> \
<image xlink:href="data:image/jpg;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" x="0" y="0" width="100" height="100" /> \
</svg>';
// this returns a working image
// res.set('Content-Type', 'image/svg+xml');
// return res.send(svg);
res.set('Content-Type', 'image/png');
var newsvg = new Rsvg(svg);
var svgString = newsvg.render({
format: 'png',
width: 100,
height: 100
}).data;
return res.send(svgString);
Happy to know if I am doing something completely wrong
Thanks!
The text was updated successfully, but these errors were encountered:
Using a data-uri as xlink:href, I am able to render/return an svg, which I can convert to png successfully using
convert
in shell. But when calling render the image disappears, with apparently no errors.Happy to know if I am doing something completely wrong
Thanks!
The text was updated successfully, but these errors were encountered: