History
According to the git history, Jakob Truelsen started this project the day after Qt 4.4 introduced QtWebKit. The initial commit seems more a demo, but soon grew to have a lot of new features. Although Qt 4.5 enhanced the QtWebKit API, the focus wasn’t on the HTML to PDF conversion use case, so the first Qt patch got introduced. As an example of how far ahead of the curve this was, the equivalent support was added for Chrome 64 in 2017 – more than 8 years later!
During the early years, the focus of both Google and Apple was the web platform – printing (especially to PDF) simply wasn’t a focus area. So although there were attempts to upstream the API changes, there wasn’t much interest in getting them merged. At the same time, the only other capable tool at that time (which is still going strong) was PrinceXML, but it was commercial and had steep license fees so the popularity of wkhtmltopdf kept on exploding.
Fun fact: Ariya Hidayat, who did an initial review of the API changes was then working at Nokia (which had acquired Qt in 2008) and would go on to develop PhantomJS, which too was based on QtWebKit and enabled a whole class of other tools to be developed.
Even as the upstreaming work stalled, Jakob and other contributors kept developing new features and extending the Qt patches. Once Qt 5.0 was released in 2012, due to a quirk in the way C++ libraries are developed meant that no new APIs could be introduced in the Qt 5.x lifecycle.
During the 2012-2014 timeframe, the project was stagnant – the number of users kept on increasing but the number of developers didn’t. This resulted in a lot of issues being created in the tracker. In most open-source projects, some of the users eventually step up and become contributors – which didn’t happen as the project was an intersection between Qt and WebKit (both written in C++) while most users were just familiar with HTML, CSS and JS.
Meanwhile, interesting things were happening in the wider world. Google decided to fork WebKit into Blink in April 2013, and Qt decided to follow with it by announcing Qt WebEngine within 6 months. QtWebKit was eventually deprecated in 2015 and removed in 2016.
Back in wkhtmltopdf-land, a shiny new 0.12.0 release happened in early 2014. Ashish Kulkarni became the maintainer. However, the release was based on Qt 4.8.5 while Qt 5.0 had already been released.
Initially, QtWebKit 2.3 seemed promising but wasn’t officially supported by Qt.
A fork of QtWebKit ( QtWebKit 5.212) revived in 2019 with funding via Patreon and GitHub.
This branch is 2947 commits ahead, 9266 commits behind WebKit:master.
Google has made great strides since 2016 focusing on Printing/PDF. The puppeteer page.pdf API is quite similar to wkhtmltopdf’s options.
This has led to a Blink monoculture – almost everyone uses the same browser engine, which doesn’t feel healthy long-term.
Summary
- Qt 4 hasn’t been supported since 2015, WebKit in it hasn’t been updated since 2012.
- Qt 5 removed QtWebKit in 2016. Development stopped in 2012, fixes continued till 2015.
- QtWebKit 5.212 is still used by many Linux distros despite being outdated.
- qtwebkit-dev-wip is not ready for release yet.
- For effective upstream patching, maintenance must be ensured – browsers move fast for security.
If you wish to donate, sponsor QtWebKit – it helps many projects.
Future Plans
- Final 0.12.7 release by Aug 2020 to fix regressions and merge pending PRs.
- Try rebasing patches to QtWebKit 5.212.
- If successful, submit to Qt and QtWebKit projects.
- No deadlines – depends on maintainer time and volunteers.
Recommendations
- Never use wkhtmltopdf with untrusted HTML. Sanitize inputs always.
- Use AppArmor or SELinux for server-level security.
- For safe report generation, try WeasyPrint or Prince.
- For dynamic JS-based sites, use Puppeteer or its wrappers.