Wkhtmltopdf: Error: /bin/bash: wkhtmltopdf: command not found

Created on 14 Aug 2017  路  4Comments  路  Source: wkhtmltopdf/wkhtmltopdf

I installed wkhtmltopdf from the following commands:

sudo apt-get update
sudo apt-get install xvfb libfontconfig wkhtmltopdf

Following version installed successfully
wkhtmltopdf 0.12.2.4

When I am creating PDF the following error showing in mup logs

Error: /bin/bash: wkhtmltopdf: command not found

How to fix it?

Most helpful comment

After a long time facing this issue I decided to replace it by another converter.

I removed wkhtmltopdf and I installed html-pdf converter and then my problem has been solved.

Thanks!

All 4 comments

Check first where you have installed wkhtmltopdf:
whereis wkhtmltopdf

Then use xvfb-run wkhtmltopdf http://www.google.com google.pdf

That creates a new virtual frame buffer for rendering wkhtmlto*. If you are on a headless server, you will have a lot of dependencies when installing xvfb, such as x11 and fonts. If you already have a desktop, you can add :1 or :99 to whichever screen you are running your terminal and that will render using the existing session. e.g. DISPLAY=:1 wkhtmltopdf http://www.google.com google.pdf or wkhtmltopdf http://www.google.com google.pdf --use-xserver

https://stackoverflow.com/questions/20653202/wkhtmltopdf-use-xserver-option

I used the which wkhtmltopdf command and got the following:

/usr/local/bin/wkhtmltopdf

And I also checked the $PATH variable using echo $PATH its giving the following output:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I run the following command

wkhtmltopdf http://www.google.com google.pdf

Its working and giving following output

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

After a long time facing this issue I decided to replace it by another converter.

I removed wkhtmltopdf and I installed html-pdf converter and then my problem has been solved.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caleywoods picture caleywoods  路  4Comments

alankarglobant picture alankarglobant  路  4Comments

mikereape picture mikereape  路  3Comments

charlieegan3 picture charlieegan3  路  3Comments

prasadsurase picture prasadsurase  路  4Comments