SVG-to-PDFKit
SVG-to-PDFKit copied to clipboard
Doesn't work in IE11 (parseXML warning)
Hello, I have this meta for my svg
<svg
xmlns="http://www.w3.org/2000/svg"
xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="certificatePortraitTemlate"
width="794"
height="1123"
viewBox="0 0 794 1123"
xmlSpace="preserve"
orientation="portrait"
>
And with attributes xmlns
and xlink
converting to pdfkit doesn't work. PDF is empty
When I remove xmlns
and xlink
all work properly as expected
I found what it's tags need be removed when svg is parsed on IE https://github.com/canvg/canvg/issues/189
Can you attach the entire SVG?
https://gist.githubusercontent.com/romanlex/1a8de85cc6444e90f0906f5b2acc5a55/raw/a1d3de4fc14fae1c7ffc00d896c384d454b1d777/exmaple.svg
this svg without xmlns
and xlink
Add it for testing
It appears that IE adds the xmlns attribute twice, which makes the svg invalid according to the specification. The workaround is to remove it from the string (replace it with empty string)