Closed im-hamza-dev closed 2 years ago
Your code looks good, but the bug is probably caused by your SVG. Please provide a small SVG that reproduces the issue. Optimally, the issue can be reproduced in the online playground.
That file is huge. Please try to reduce it to something manageable, optimally less than 10-20 tags/elements.
I don't see that "none" is a valid value for the stroke-width attribute. Can you point me to the spec that tells what "none" should be? I guess you should simply be using "0" instead if you don't want a stroke or set the stroke itself to none?
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width
I have no glue why it's there. In my case it was generated by http://paperjs.org/reference/project/#exportsvg. But "none" seems to be interpreted as "1", probably because it's not valid, like you said, and so it's ignored: https://jsfiddle.net/grynvkbu/
We are not going to implement a lenient parser that will try to make the best out of invalid or broken svg. Please fix the SVG or the tool that created the broken SVG.
trying to add svg to pdf using jsPDF and svg2pdf but somehow got this exception:![image](https://user-images.githubusercontent.com/32700351/165418937-8693c7a2-2a55-4056-8ed2-78b42190832d.png)
let canvasWrapper = document.getElementById("svg-wrapper"); canvasWrapper.innerHTML = jsonFile;
Need some suggestions on urgent basis! Thanks