yum install xorg-x11-server-Xvfb
yum install xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi
# from EPEL; 12.3 has exploits, and this is easier
yum install wkhtmltopdf
# install systemd wunderkinder fridge art
# avoid the vietnam-war-era cult of pain that is vi
(install -o root -g root -m 755 <(cat) /etc/systemd/system/xvfb.service) <<EOF
[Unit]
Description=Virtual Frame Buffer X Server
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :42 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
[Install]
WantedBy=multi-user.target
EOF
# enable, start, check service via neu method
sudo systemctl enable xvfb.service
sudo systemctl start xvfb.service
sudo systemctl status xvfb.service
sudo systemctl daemon-reload
# install a test script. Again, avoid boomer masochism cult
(install -o root -g root -m 755 <(cat) ./wkhtmltopdf.sh) <<EOF
xvfb-run -a -s "-screen 0 1024x768x24" wkhtmltopdf "$@"
EOF
./wkhtmltopdf.sh http://www.google.com output.pdf
- https://reiners.io/installing-xvfb-in-centos/ - 2019 update, no xvfb!
- 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