dompdf not working with rotation css

2,800 views
Skip to first unread message

PHAN CHI NGUYEN

unread,
Aug 18, 2014, 4:17:47 AM8/18/14
to dom...@googlegroups.com
Hi all,

I'm using dompdf lib to export html to pdf.I use rotationZ to rotate images inside div. But it not working when exported to PDF. Please help me!

Thanks!

BrianS

unread,
Aug 18, 2014, 10:24:12 PM8/18/14
to dom...@googlegroups.com
Our transform support is decent, but apparently incomplete (and possibly outdated ... we implemented it a while ago). I checked the code and we only support rotate(), not any of the axis variants such as rotateZ(). For the purposes of rotating an image on the Z axis you can use the rotate function. Be sure to specify the transform origin, you probably want 50%. Like so:

<img src="http://placekitten.com/g/200/200" style="transform: rotate(45deg); transform-origin: 50%;">

Would you mind opening an issue for this. We'll need to work on the code, but apparently our docs need to be updated to reflect current support.
Reply all
Reply to author
Forward
0 new messages