Solve Wkhtmltopdf failed (error code: -6) di OpenERP


It's likely that you'll have to manually compile the latest version of wkhtmltopdf and qt:
  1. Remove wkhtmltopdf and related package
$ sudo apt-get remove libqt4-dev qt4-dev-tools wkhtmltopdf

$ sudo apt-get autoremove
  1. Install requirement package for compiling
$ sudo apt-get install openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
  1. Clone from git wkhtmltopdf and qt source
$ git clone git://github.com/wkhtmltopdf/wkhtmltopdf.git wkhtmltopdf

$ mkdir qt-wkhtmltopdf && cd qt-wkhtmltopdf

$ git clone https://www.github.com/wkhtmltopdf/qt --depth 1 --branch wk_4.8.7 --single-branch .
  1. Compile qt
$ sudo ./configure -nomake tools,examples,demos,docs,translations -opensource -prefix "`pwd`" `cat ../wkhtmltopdf/static_qt_conf_base ../wkhtmltopdf/static_qt_conf_linux | sed -re '/^#/ d' | tr '\n' ' '`

$ sudo make -j3

$ sudo make install

  1. Compile wkhtmltopdf
$ cd ../wkhtmltopdf

$ sudo ../qt-wkhtmltopdf/bin/qmake

$ sudo make -j3

$ sudo make install
  1. Reboot
$ sudo reboot