dompdf/php-svg-lib

SVG poly line being "closed" in PDF

jbajou opened this issue · 2 comments

jbajou commented

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!

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

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

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