I am using domtoimage to try to turn my html div into <svg>
. The function from domtoimage returns the string:
data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="288" height="1920"> .......... </svg>
I can set this string as the src
of an <img>
, but the other plugin I'm using (jsPDF) cannot use that, it needs <svg>
.
I figured I could strip the beginning part off and add just the svg
tag to the document but this results in a really odd svg with "%0A" everywhere, which I cannot strip from the string.