Skip to content

Incorrect SVG rendering in TCPDF since version 6.8.2 #834

@braukma

Description

@braukma

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: Image ❌ TCPDF 6.8.2 / 6.10.0 → distorted rendering Image ✅ TCPDF 6.6.5 → correct rendering ![Image](https://github.com/user-attachments/assets/52363fe0-2eee-47c7-92d7-4ee9749e9a47) I am not so sure working here in GitHub, but I think I managed to include the SVG as well. I also had the issue with other SVG files (for the record: I use an extension within typo3 CMS that relies on tcpdf). I managed to locate the issue down to tcpdf and with a bit of AI help generated this testcase. Jürgen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions