dompdf / php-svg-lib

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

Path should not be closed if it has stroke #99

Closed ljadrbln closed 1 year ago

ljadrbln commented 1 year ago

Hello,

If svg contains unclosed path and if this path has a stroke in the generated PDF path will be closed:

SVG:

path

PDF: image

bsweeney commented 1 year ago

Thought this issue was fixed with the last release of php-svg-lib (7926073722e5698c9b3926a6339e35232a7c4165) but obviously missed something.

jbajou commented 1 year ago

Is there an ETA on this?

bsweeney commented 1 year ago

Not yet. I'm trying to finish up the next release of Dompdf then I'll turn my attention to the next php-svg-lib release.

bsweeney commented 1 year ago

Ah, the issue is with some missing logic that was not put into the Dompdf version of Cpdf, 😞. So this issue will be fixed with the next Dompdf release.

jbajou commented 1 year ago

That's amazing news! What kind of deadline are we looking at ?

bsweeney commented 1 year ago

Still can't say? I'd like to finish up over the next few weeks if possible. I'm in the process of reviewing issues assigned to the next Dompdf release to see what's reasonable to include vs push to the next release.

jbajou commented 1 year ago

Ok, I'm not sure I have the necessary skills to help out here, but if there is some documentation or anything I could look at to PR the thing, feel free to let me know

bsweeney commented 1 year ago

I just merged the fix into the main branch so if you want it now you can reference dev-master (if your project setup allows for that).

jbajou commented 1 year ago

Thanks. I guess it won't be easy as we use barryvdh/laravel-dompdf, I think we will have to wait as this package explicitly required ^2 of DomPdf.

bsweeney commented 1 year ago

It's possible via Composer configuration by redefining the version reference though I'd have to play around with it to remind myself how to set it up.

jbajou commented 1 year ago

I tried to play around with composer but no luck so far

bsweeney commented 1 year ago

The current version of laravel-dompdf specifies "^2.0.1" so assuming you're using it I think you could do something like:

{
    "require": {
        "barryvdh/laravel-dompdf": "^2.0.1",
        "dompdf/dompdf": "dev-master as 2.0.1.1"
    }
}

You'll want to remove that alias at some point, but it won't interfere with future release of Dompdf since we don't version that deep.

jbajou commented 1 year ago

It works indeed! Thank you so much for that!

bsweeney commented 1 year ago

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