WKHTMLTOPDF Installation error on Ubuntu
In case anybody is having the similar issue, I got it fixed by following this article.
All features are working perfectly now.
Article contents:
The wkhtmltopdf shell utility is used to generate PDF documents from HTML using WebKit. I’ve tried a few ruby gem wrappers that make use of wkhtmltopdf, but I’ve found that I like using the wicked_pdf gem the best. Regardless of what wrapper you use to call wkhtmltopdf, here are the steps to get wkhtmltopdf installed on Ubuntu (minor adjustments will be needed for non Debian based distributions).
Remove wkhtmltopdf installed using apt-get previously (if previously installed).
sudo apt-get remove --purge wkhtmltopdf
Install dependencies.
sudo apt-get install openssl build-essential xorg libssl-dev
Download the static binary as per the architecture (i386/amd64). Extract it, change the owner and then copy it to /usr/local/bin.
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
sudo chown root:root wkhtmltopdf-i386
sudo cp wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
For amd64 bit
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo cp wkhtmltox/bin/wkhtmlto* /usr/bin/
How to install package wkhtmltopdf in ubuntu
Just download the tar file, put it at somewhere ,then create a soft link to the bin file,like this:
sudo ln -s xxxx/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
That all
How to install the latest wkhtmltopdf on ubuntu 12.04
Purge the added PPAs:
sudo apt-get install ppa-purge
sudo ppa-purge ppa:<user/ppa_name>
And use the official packages.
How to install wkhtmltopdf on a linux based (shared hosting) web server
I've managed to successfully install wkhtmltopdf-amd64 on my shared hosting account without root access.
Here's what i did:
Downloaded the relevant static binary v0.10.0 from here: http://code.google.com/p/wkhtmltopdf/downloads/list
EDIT: The above has moved to here
via ssh on my shared host typed the following:
$ wget {relavant url to binary from link above}
$ tar -xvf {filename of above wget'd file}
you'll then have the binary on your host and will be able to run it regardless of if its in the /usr/bin/ folder or not. (or at least i was able to)
To test:
$ ./wkhtmltopdf-amd64 http://www.example.com example.pdf
- Note remember that if you're in the folder in which the executable is, you should probably preface it with
./
just to be sure.
Worked for me anyway
Installing WKHTMLtoPDF 0.12.x 64 bit on Ubuntu 12.04.5 (Dreamhost VPS)
The steps taken to install WKHTMLtoPDF 0.12.x onto Ubuntu 12.04.5 derived from the above question, using these resources (1 and 2) where:
sudo -s
add-apt-repository ppa:pov/wkhtmltopdf
If add-apt-repository is not a recognized command:
apt-get install software-properties-common python-software-properties
Continue if add-apt-repository was a recognized command, or after running the abov command to and rerunning the first command:
apt-get update
apt-get install wkhtmltopdf
With regards to Grub, I don't know what you should choose. For me it was made by the fact I couldn't say no, and had to choose yes based on some issue related to Ubuntu.
Once installed run:
wkhtmltopdf --version (should say wkhtmltopdf 0.12.1)
and then do a quick test of the install:
wkhtmltopdf http://www.google.com google.pdf
If this results in a command not found error you'll have to install xvfb:
apt-get install xvfb
And run the command below (found here) to generate your PDFs:
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf http://www.google.com google.pdf
wkhtmltopdf (with pdfkit) installed on Ubuntu but not working in Rails
What path does which wkhtmltopdf return and is it different than the path in your development environment?
PDFkit expects wkhtmlpdf to be in /usr/local/bin so if you haven't installed the wkhtmlpdf binary to that location, make sure you specified the path in an initializer like so:
# config/initializers/pdfkit.rb
PDFKit.configure do |config|
config.wkhtmltopdf = '/path/to/wkhtmltopdf'
# config.root_url = "http://staging.myapp.com" # Use only if your external hostname is unavailable on the server.
end
If your problem isn't related to PDFkit trying to call wkhtmltopdf from the wrong path on the server, have you tried seeing if another gem like wicked_pdf is able to use wkhtmltopdf properly?
How to install wkhtmltopdf with patched qt?
You can install wkhtmltopdf
with --disable-smart-shrinking
option from
wkhtmltopdf.
Download and Install it.
http://wkhtmltopdf.org/usage/wkhtmltopdf.txt
The Document say
wkhtmltopdf 0.12.2.1 (with patched qt)
and
--disable-smart-shrinking Disable the intelligent shrinking strategy
used by WebKit that makes the pixel/dpi
ratio none constant
Related Topics
How to Get a List of Programs Running with Nohup
How to Base64 Encode Image in Linux Bash/Shell
How to Move All Files Including Hidden Files into Parent Directory via *
Check Free Disk Space for Current Partition in Bash
Using a Remote Host's Usb Port as Local Usb (Linux and Windows)
How to Use Nohup to Run Process as a Background Process in Linux
How to Run Vi on Docker Container
How to Install Crontab on Centos
How to Copy Text from My Xterm Without a Mouse
Check Whether a Certain File Type/Extension Exists in Directory
How to Shield a CPU from the Linux Scheduler (Prevent It Scheduling Threads Onto That Cpu)
How to Delete All Files Older Than 3 Days When "Argument List Too Long"
How to Know Which of the /Dev/Input/Eventx (X=0..7) Have the Linux Input Stream
Check Battery Level of Connected Bluetooth Device on Linux
Find Files in Created Between a Date Range
Best Practices for Git Repositories on Open Source Projects
Pass Command-Line Arguments to Grep as Search Patterns and Print Lines Which Match Them All