Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a version of wkhtmlto(pdf/image) that supports CSS3 Columns?

Tags:

qt

wkhtmltopdf

I am using both wkhtmltopdf and wkhtmltoimage to generate my preview image and a pdf of a document. The only problem is, I need column support. Getting it to work with Javascript is becoming time consuming and really getting me nowhere.

Is there a build download out that has been built against a version of QT that has CSS3 support? I seem to be having problems finding said build.

like image 548
Justin Lonas Avatar asked Oct 28 '11 04:10

Justin Lonas


2 Answers

With the release of Qt5, QtWebKit is said to have more HTML5 support. You could try building wkhtmltopdf on Qt5, or, if you don't like that, try a trunk-source build of WebKit and use the QMake project files to build. Good luck with that - WebKit is a nightmare to build.

EDIT: Started a Qt5 port of wkhtml2pdf, but apparently it (by default) needs a custom build of WebKit that I don't have the time or skills to do. See https://github.com/antialize/wkhtmltopdf/pull/18 for my work so far.

like image 145
waddlesplash Avatar answered Nov 20 '22 03:11

waddlesplash


PhantomJS is built around QtWebKit, which supports CSS3 to some extent. Check this example, which renders PDF (can be easily modified to output PNG):

https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js

To check the support of the CSS3 selector you're interested in, just render the correspondent official test suite page: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/xhtml/index.html

like image 2
creaktive Avatar answered Nov 20 '22 03:11

creaktive