Skip to content

Instantly share code, notes, and snippets.

@smali-kazmi
Created September 15, 2014 17:01
Show Gist options
  • Save smali-kazmi/8447758b0301c26bd34e to your computer and use it in GitHub Desktop.
Save smali-kazmi/8447758b0301c26bd34e to your computer and use it in GitHub Desktop.
Install wkhtmltopdf on vagrant ubuntu
# To Install wkhtmltopdf
sudo apt-get install -y wkhtmltopdf
sudo apt-get install -y xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' | sudo tee /usr/bin/wkhtmltopdf.sh > /dev/null
sudo chmod a+x /usr/bin/wkhtmltopdf.sh
sudo ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
sudo apt-get install libicu48
@bhaidar
Copy link

bhaidar commented Dec 3, 2019

Hi

I got this error after installing and trying out the wkhtmltopdf:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-vagrant'
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

@DanDvoracek
Copy link

Update FYI: with an up to date vagrant box (or up to date Homestead), you will need to do this:

sudo apt-get install libicu63

Instead of this:

sudo apt-get install libicu48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment