yum install xorg-x11-server-Xvfb
yum install xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
rpm -ivh wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
vim xvfb.service
cp xvfb.service /etc/systemd/system/xvfb.service
sudo systemctl enable xvfb.service
sudo systemctl start xvfb.service
sudo systemctl status xvfb.service
sudo systemctl daemon-reload
vim wkhtmltopdf.sh
chmod a+rx wkhtmltopdf.sh
./wkhtmltopdf.sh http://www.google.com output.pdf
At the end edit sudo nano /usr/bin/xvfb-run script and comment out the section
if ! which xauth >/dev/null; then
error “xauth command not found”
exit 3
fi
- https://github.com/mikehaertl/phpwkhtmltopdf
- https://gist.github.com/nkm/91006178753df6f503c1
- https://github.com/JazzCore/python-pdfkit/wiki/Using-wkhtmltopdf-without-X-server
- http://stackoverflow.com/questions/9604625/wkhtmltopdf-cannot-connect-to-x-server http://vinh-tran.tumblr.com/post/50988759673/which-no-xauth-in-null-xvfb-run-error-xauth