Mehic.info

How to install wkhtmltopdf on shared hosting (Ubuntu)?

First obtain .deb file from http://wkhtmltopdf.org/downloads.html. Be sure that you select proper version for your operation system.

Following steps are for Ubuntu 12.04. :

  1. Execute:
    wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-precise-amd64.deb

    You should have wkhtmltox-0.12.2.1_linux-precise-amd64.deb downloaded in your directory

  2. Execute:
    ar vx wkhtmltox-0.12.2.1_linux-precise-amd64.deb

    You should now have these folders:
    debian-binary
    control.tar.gz
    data.tar.xz

  3. Execute:
    tar -xvf data.tar.xz

    You should now have folder “usr” in your directory

  4. Go to “usr/local/bin” and execute
    ./wkhtmltopdf http://google.ba google.pdf

    Response:

    Loading pages (1/6)
    Counting pages (2/6)
    Resolving links (4/6)
    Loading headers and footers (5/6)
    Printing pages (6/6)
    Done

P.S. these actions might change your permissions in root folder, so execute following code:
To find your group name run `id` in the console.

[aaa]$ id
uid=15146046(mmehic) gid=1537964(pg8402156) groups=1537964(pg8402156) 

then simply execute:

chmod  750 /home/mmehic

Your wkhtmltopdf  is installed, now just point your configuration to this binary file and enjoy 🙂