-
Notifications
You must be signed in to change notification settings - Fork 646
Getting Started Installing wkhtmltopdf
Francisco Quintero edited this page Oct 25, 2019
·
4 revisions
- Remove any
wkhtmltopdf
installed usingapt-get
sudo apt-get remove --purge wkhtmltopdf
- Install necessary dependencies
sudo apt-get install openssl build-essential xorg libssl-dev
- Download the static binary as per the architecture(i386/amd64)
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
- Untar de compressed file
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
- Changer ownership of the executable
sudo chown root:root wkhtmltopdf-i386
- Move it the expected path to be usable system wide
sudo cp wkhtmltopdf-i386 /usr/bin/wkhtmltopdf
-
Setup your
wicked_pdf
gem and runbundle install
-
Download the executable
http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltox-0.11.0_rc1-installer.exe
-
Place it in your
#SITE
directory -
create an initilizer in
config/initializers/wicked_pdf.rb
with following code:
WickedPdf.config = {
:exe_path => '#SITE\wkhtmltopdf\wkhtmltopdf.exe'
}
- Make sure that your server is running in a context that can write to that location with any pdf files otherwise, they will fail. Also don't miss the
.exe
part.