dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.4k stars 77 forks source link

Base64 SVG QR code is not rendered in Adobe Reader #125

Open zaalbarxx opened 2 weeks ago

zaalbarxx commented 2 weeks ago

Hi! We encountered a strange issue where QR code rendered inside img tag (as base64 SVG) is not displayed at all in Adobe Reader. It happens only with version >=2.0 of DOMPDF, previously we had 1.x and it worked fine. It is quite interesting because it renders properly in all other PDF readers, including Chrome and other desktop PDF readers. Any idea what could have changed between versions that it does not work with Adobe ? Rendering QR code as base64 PNG works fine BTW.

It's Laravel code, but it should not matter at all.

image

hello_1x.pdf hello_2x.pdf

bsweeney commented 2 weeks ago

I can confirm that I see the same issue using the SVG string that's in the included PDF. I do not have any ideas right now what would cause this, but will take a look.

bsweeney commented 1 week ago

Transferring this issue to php-svg-lib since that's where it will need to be addressed.

It looks like the cause is the transparent stroke styling. If I remove that attribute or set it to "none" then Adobe renders as expected. I suspect, but have not yet confirmed, that something about the graphic state for the stroke is bleeding over into the fill, making the paths transparent.