dompdf / php-svg-lib

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

SVG poly line being "closed" in PDF #101

Closed jbajou closed 1 year ago

jbajou commented 1 year ago

Hello,

I'm using DomPDF to generate a PDF where a small SVG is embedded (I use the base64_encode() trick with an <img /> tag. With the following svg:

<svg viewBox="0 0 500 500" width="500"><polyline id="SvgjsPolyline1007" points="113,198 113,198 113,198 116,200 127,207 148,225 168,245 181,262 189,275 192,282 192,284 193,285 193,287 196,290 202,293 220,296 248,294 280,284 304,272 314,263 318,255" stroke="#000000" stroke-width="2" fill-opacity="0"></polyline></svg>

I'm expecting this: Screenshot 2022-12-28 at 8 31 23 PM But the generated PDF outputs this: Screenshot 2022-12-28 at 8 33 08 PM The rendering actually "closes" the polyline, tracing from the last point to the first one (which I absolutely don't want).

Does anyone have an idea to prevent this line to be drawn ?

Thanks!

bsweeney commented 1 year ago

This is probably the same issue as #99. We'll review for the next release.

I don't have a work-around at present.

bsweeney commented 1 year ago

FYI Dompdf 2.0.2 was released that includes the updates for the Cpdf library.