Incorrect SVG rendering in TCPDF since version 6.8.2
Description: I noticed that SVG files are no longer rendered correctly starting with TCPDF version 6.8.2. In my test case, a simple green downward arrow SVG is displayed properly in version 6.6.5, but gets distorted in 6.8.2 and 6.10.0.
Steps to reproduce: Use the following minimal PHP script:
AddPage(); $pdf->ImageSVG('@' . $svg, 15, 30, 50, 50, '', '', '', 0, false); $pdf->Output('php://stdout', 'I'); php testpgm.php icon.svg > output.pdf Expected result: A clean green downward arrow. Actual result: Starting with TCPDF 6.8.2, the SVG is rendered incorrectly (see comparison below). Comparison: ✅ TCPDF 6.6.5 → correct rendering ❌ TCPDF 6.8.2 / 6.10.0 → distorted rendering Screenshots:
@braukma Could you please also provide the full source of the SVG file to this issue here?
Hi,
sure I can. I tried to include it but maybe I failed. I’ll attach it here. If oit fails again, let me know – I’ll find another way
Mit freundlichen Grüßen Jürgen Braukmann
@braukma I think it didn't work. I don't see an image in your second comment and the images in the first comment are only available as PNG.
You could just open the SVG file in a text editor and then copy everything and paste it here. SVG files are XML based.
Yes, I know these little basterds are XML. Hoped to manage different. Here we go: (And hope the Character Set won’t interfere ☺)