-
-
Save Oxicode/062649ad798ffb8ce16c720d3202acf2 to your computer and use it in GitHub Desktop.
Revisions
-
brunogaspar created this gist
Jun 30, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ ## Install wkhtmltopdf on Ubuntu This was tested on: - Ubuntu 14.04 x64 - Ubuntu 16.04 x64 #### Step 1 Install the xvfb server by running ```sh sudo apt-get install xvfb ``` #### Step 2 Get the latest stable version wkhtmltopdf from [http://wkhtmltopdf.org/downloads.html](http://wkhtmltopdf.org/downloads.html) page. ```sh wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb ``` #### Step 3 Install wkhtmltopdf: ```sh sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb ``` If you see dependencies errors while installing, you'll need to run the following ```sh sudo apt-get -f install ``` Now that the dependencies are installed just run the install command, again. #### Step 4 Create a symbolic link in `/usr/local/bin/`: ``` echo 'exec xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf.sh >/dev/null && sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh ``` #### Step 5 Test that everything is working as expected ```sh wkhtmltopdf http://www.google.com google.pdf ``` If you see `Done` then everything is installed correctly and you're ready to generate some PDF's :D