13

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.

vipw
  • 7,593
  • 4
  • 25
  • 48
Justin Lonas
  • 189
  • 1
  • 11
  • Are you using 0.11.0_rc_1? because 0.9.9 has a lot of missing features to work around. – Nathan Nov 04 '12 at 20:50
  • I am still wondering why 0.11.0_rc1 is not supporting multi columns. The changelog of domepdf says that it's using at least qt4.7. This version of qt should already support multi columns, shouldn't it? If not, how do I have to understand this example: [link](http://doc.qt.digia.com/4.7/webkit-webkit-guide-css-css3-multicol-css.html) – Johnson_145 Mar 20 '13 at 11:22

2 Answers2

4

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.

waddlesplash
  • 743
  • 1
  • 6
  • 25
  • Awesome. If you see a build somwhere or make one yourself I would Love to see it in action! – Joel Peltonen Jan 20 '13 at 20:03
  • 1
    Just tried the Qt demo browser on Linux (no MinGW support yet) and it scores **64%** on the [CSS3 test](http://css3test.com/). Firefox 18 (latest) ***only scores 56%***! – waddlesplash Jan 20 '13 at 23:36
  • I would be very interested in this project, too. Any process considering your work? – Johnson_145 Mar 20 '13 at 11:24
  • Right now the devs need to recompile QtWebKit against Qt5 so that it works, because wkhtml2pdf uses a custom build of QtWebKit. So my work is useless until then. – waddlesplash Mar 20 '13 at 14:59
2

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

creaktive
  • 5,193
  • 2
  • 18
  • 32