Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Matrix transform not working on SVG #65

Open
raduvarga opened this issue Dec 18, 2020 · 1 comment
Open

Matrix transform not working on SVG #65

raduvarga opened this issue Dec 18, 2020 · 1 comment

Comments

@raduvarga
Copy link

I am trying to generate a PDF with dompdf which includes a SVG that has a matrix transform at its top level.
The SVG renders correctly in the browser, in the PDF however the matrix transform is not being applied.

In one specific example, the matrix transform "matrix(-1, 0, 0, 1, 0, 0)" is doing a flip on the x axis, however if I replace the matrix with a "scaleX(-1)" transform, this does get applied correctly in the PDF.
Inside the SVG, there are many other matrix transforms that are being respected, so it seems that just the top level one is not working. I have also tried to wrap the SVG with a div that contains that matrix transform, with no success.

Thoughts?

@raduvarga
Copy link
Author

raduvarga commented Dec 18, 2020

Correction for the above: The "scaleX(-1)" fix only works if I apply it too the "style" of the parent "img" element where the SVG is being shown, it doesn't work on the top level of the SVG itself, nor does it work on the "transform" property of both "img" or "svg".

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant