问题
I installed wkhtmltopdf from the following code
sudo apt-get install wkhtmltopdf
But when I am creating PDF then it is generating following error
Error: /bin/bash: /usr/bin/wkhtmltopdf: No such file or directory
回答1:
It appears that when you're trying to run wkhtmltopdf, it's not finding the program to execute.
You can try to locate it with locate wkhtmltopdf
. That should return the path to the executable. If that doesn't return a path, you can use this (but it will take longer): find / -name wkhtmltopdf 2>/dev/null
.
Once you've got the path of the executable, make sure to add it to your $PATH, so it can be called from anywhere on the command line. See this post for instructions on how to add to the path variable.
回答2:
I think the correct path would be /usr/local/bin/wkhtmltopdf
. You can get it by which wkhtmltopdf
command.
回答3:
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 PDF file created successfullu
来源:https://stackoverflow.com/questions/45627142/wkhtmltopdf-no-such-file-or-directory-closed