Forked from tejastank/fix.wkhtmltopdf.odoo.snippetbucket.erp.open.source.seo.sh
Created
July 1, 2017 08:30
-
-
Save hqman/a0474c04a76a0d9dc2b66f899945e751 to your computer and use it in GitHub Desktop.
Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to Fix it: | |
1. Remove wkhtmltopdf and related package | |
$ sudo apt-get remove libqt4-dev qt4-dev-tools wkhtmltopdf | |
$ sudo apt-get autoremove | |
2. 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 | |
3. 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 . | |
4. 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 | |
5. Compile wkhtmltopdf | |
$ cd ../wkhtmltopdf | |
$ sudo ../qt-wkhtmltopdf/bin/qmake | |
$ sudo make -j3 | |
$ sudo make install | |
6. Reboot | |
$ sudo reboot | |
#http://www.grobak.net/id/blog/how-fix-wkhtmltopdf-failed-error-code-6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This solucion worked for me getting the same error i did the next steps :
I run the Ubuntu Server 16.04.2 LTS with odoo v8
Remove wkhtmltopdf and related package
$ sudo apt-get remove libqt4-dev qt4-dev-tools wkhtmltopdf
$ sudo apt-get autoremove
Install this packages ( some of them may be in the last version installed allready on your server)
$ sudo apt-get install openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
Download the wkhtmltox-0.12.1_linux-trusty-amd64.deb
$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
$ sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
Reboot the server, clean the cookies in your web browser and try it !
安装中文字体
sudo apt-get install ttf-wqy-zenhei