dompdf/php-svg-lib

Path should not be closed if it has stroke

ljadrbln opened this issue ยท 14 comments

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

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

jbajou commented

Is there an ETA on this?

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.

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

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

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

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

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

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.

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

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

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

It works indeed! Thank you so much for that!

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