Rendering rotated text to PDF in PhantomJS

十年热恋 提交于 2019-12-05 04:24:25

I tested it with PhantomJS 1.9.18 in a node application.

With -webkit-transform and -webkit-transform-origin the text on the generated PDF is rotated. Withouth the -webkit prefixes its only rotated when I view it with a browser, not rendered in the pdf.

So you should change your CSS to

.rotate {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
    -webkit-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
}

Phantom JS is based on Webkit. You need to use -webkit- prefix for incompatible css rules.

.rotate {
    -webkit-transform: rotate(90deg);   
    -webkit-transform-origin: 50% 50%;   
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!