Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.06k stars 670 forks source link

SVG rendering problem - part of picture not visible in pdf render #2240

Open lafar6502 opened 3 weeks ago

lafar6502 commented 3 weeks ago

(continued from #2239)

Thanks, you're right - markers were missing. But after removing the markers - still the picture is not rendered correctly. But this time i'm not getting any error message. pdf: image svg: something like image

Here's the test case - updated svg. test_p2.zip RG

Originally posted by @lafar6502 in https://github.com/Kozea/WeasyPrint/issues/2239#issuecomment-2307145347

(edit) i think nesting of SVG elements might be related to this problem

liZe commented 2 weeks ago

i think nesting of SVG elements might be related to this problem

Yes, that’s because svg tags with no size are not supported. We could do the same hack as cf72dfc.

lafar6502 commented 2 weeks ago

You mean, change <svg> to <g> tag? For some cases it would work, but i have also a case where a larger svg is composed of sub-svgs coming from another place, so some xml manipulation would be necessary.

liZe commented 2 weeks ago

You mean, change to tag?

I mean we should use the same fix in WeasyPrint for svg than the one we used for symbol in cf72dfc.

Using g instead of svg in your sample should work as a workaround, but let’s really fix that in WeasyPrint instead!