Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sharshenov/edaca25b3b9094359c95f4ae66cd4222 to your computer and use it in GitHub Desktop.
Save sharshenov/edaca25b3b9094359c95f4ae66cd4222 to your computer and use it in GitHub Desktop.
Using wkhtmltopdf without X server
apt-get install wkhtmltopdf
apt-get install xvfb
echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment