0

I don't have a clue about how to install the latest stable version of wkhtmltopdf. When I download and uncompress the tar.xz I get four folders:

  • lib
  • bin
  • include
  • share

What should I do with this files?

MikeVelazco
  • 103
  • 1
  • 4

2 Answers2

1

You can install it without that files, just open terminal and run:

sudo apt-get install wkhtmltopdf

Then use it from the command line like:

wkhtmltopdf example.org
wkhtmltoimage example.org

Or you can copy the files you've downloaded to /usr folder using your window manager or running sudo mv * /usr from in the directory you uncompressed the tar.xz file.


Or you can run the file from where you extracted them using:

chmod -R u+x /extracted/path
./extracted/path/bin/wkhtmltopdf <arguments>

Cheers.

razorx
  • 441
  • 3
  • 10
  • 1
    That's a valid way to install it, although the version of `wkhtmltopdf` in the Ubuntu repositories is already slightly outdated. – edwinksl Jun 22 '16 at 21:10
  • I've improved my answers about it. Just copy the files to /usr directory. – razorx Jun 22 '16 at 21:11
  • That requires `sudo` privileges, and there is no need to move them to `/usr` anyway. You can just run the binary from whenever the tarball is extracted. – edwinksl Jun 22 '16 at 21:12
  • Thanks, I've updated my answer according to that information, asker asked about installing the software, though, there's no difference at all, there are a lot of ways of doing it. – razorx Jun 22 '16 at 21:17
  • 1
    There are indeed many ways, but unless the OP explicitly wants the binary to be available to _all_ users, I would avoid telling him to use `sudo` to `mv` files into `/usr/local/bin`. – edwinksl Jun 22 '16 at 21:21
  • Thanks, I've tried this before the answer, it works!, Thank you. – MikeVelazco Jun 22 '16 at 22:04
  • @razorx Well one thing is missing here, if you are installing `wkhtmltopdf` manually then you should also install some dependencies. `apt-get install libxrender1 fontconfig xvfb` . Also Would be nice to move them to to `bin` folder by running `cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf` – Bikal Basnet Jun 16 '17 at 07:20
0

The wkhtmltopdf binary is found in the bin/ directory ("bin" stands for binaries). Therefore, to run it in the terminal, cd to bin/ and run ./wkhtmltopdf with appropriate arguments.

edwinksl
  • 23,569
  • 16
  • 74
  • 100