Closed zornwal closed 3 years ago
Thanks for the issue report. Please try to reduce your SVG until only the missing path remains.
Apologies, I have updated with a link to the playground with just the disappearing path.
Obviously this is caused by the empty clippath attribute. Of course the workaround would be to remove it.
If I remove the clip-path, the line will be visible through the nodes on the graph, though. If there is no other course of action, I will remove the nodes (and the clip-path). Why is an empty clip-path an issue? (I know next to nothing about SVG)
Well, this might be just a bug in svg2pdf, but as to why an empty-clip path might be an issue, you should ask the standard committee.
Empty clip paths are not allowed and against the spec, I would say - use "none" (which is the default), if you don't need a clip path: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/clip-path
I guess though, that you stripped-down the example a bit too much and that you still need a clip path and the original problem is another problem
Seems to be a small bug in svg2pdf:
An IRI reference to another graphical object within the same SVG document fragment which will be used as the clipping path. If the IRI reference is not valid (e.g it points to an object that doesn't exist or the object is not a ‘clipPath’ element) the ‘clip-path’ property must be treated as if it hadn't been specified.
hi @HackbrettXXX will this fix be included in the next release of svg2pdf? I am interested to know the date for the next release of svg2pdf. thanks
@jagnathan yes it will be included in the next release but I can't tell you exactly when we will release it. Depends on the next release of jsPDF.
Describe the bug My SVG is missing paths when printing. They ought to be there and are rendered correctly in the playground SVG preview, but are also missing in the playground PDF preview.
jspdf@2.3.1 svg2pdf.js@2.1.0
To Reproduce Use the playground
(full svg)
Expected behavior I would have expected the paths in the graph to be included. I am aware that fonts need to be included in order to perfectly mirror the rendered svg.
Screenshots
Desktop (please complete the following information):