php-svg-lib icon indicating copy to clipboard operation
php-svg-lib copied to clipboard

`stroke-dasharray: none;` handled incorrectly

Open stefan-beyer opened this issue 3 years ago • 2 comments

If I create a PDF with html containing an img tag with an svg file, everything works fine until the svg file contains the css poperty stroke-dasharray as in style="stroke-dasharray:none;". If it contains that property, everything after that element is kind of white. At least in some PDF viewers (like Atril 1.24.0). I can still select the text in the pdf, so it is there...

dompdf version 1.2.2 (via barryvdh/laravel-dompdf) php 7.4.3

stefan-beyer avatar Jun 16 '22 14:06 stefan-beyer

Sounds like maybe an issue with php-svg-lib not resetting a state value in the PDF.

bsweeney avatar Jun 16 '22 14:06 bsweeney

It looks like the issue is incorrect handling of a value of none, which is treated the same as if you had provided an actual dash array specification. The issue will need to be fixed in SvgLib.

For now you can work around the bug by using a value of 0 instead of none.

bsweeney avatar Aug 13 '25 13:08 bsweeney