Open WBNet-Wout opened 1 year ago
What immediately stands out, is that the problematic area isn't actually a vector, but an embedded (greyscale, PNG) bitmap. And it gets weirder, extracting the bitmap, shows it's actually being inverted on the fly.
But the better solution might actually be to replace the bitmap data with a traced vector.
Sidenote: I don't think you need to base64 encode an SVG, SVG is allowed directly into HTML these days.
The problem is that some SVG filters are not handled (namely feColorMatrix
in your example).
Here’s a smaller file adapted from your example:
I don’t know what’s possible to do in PDF, but I suppose that it’s possible to handle more primitives. If someone is interested, two of them are handled in apply_filters
.
With below HTML the embedded SVG is not properly rendered when converted to PDF using WeasyPrint.
test.html
In a browser it looks like this (note the GLS logo at the bottom right):
In a PDF generated by WeasyPrint it looks like this instead: