问题
When I run the executable "wkhtmltopdf-amd64" (from Linux), I get the following output:
QPainter::begin(): Returned false============================] 100%
Error: Unable to write to destination
Exit with code 1 due to http error: 403 Forbidden
I have seen in other forums that this is due to lack of permissions to write the temporary file. Which directory do I need to make writable in order to allow "wkhtmltopdf-amd64" to create the temporary file?
回答1:
make sure you have access to the directory ie : you are the owner and have write permissions when you run wkhtmltopdf http://www.google.com test.pdf
you can always su sudo and try it out but generally i wouldn't write to any where but home just so i dont store junk in important places.
回答2:
I had the same problem.
"You're probably missing the 32bit libraries. Try: sudo aptitude install ia32-libs" - http://code.google.com/p/wkhtmltopdf/wiki/static
Worked for me
回答3:
I know I'm late to the game here, but I was having this same issue. My issue was the fact that I was trying to write to a directory that didn't exist.
I had assumed that wkhtmltopdf would create the directories that I passed it. It did not.
Making sure the directories existed before trying to create my pdf solved it.
I hope this helps someone else.
回答4:
I had this error for first time recently. I only want to add that if the name of the pdf have an special character this error will persist, independently if you have all the permissions granted. Be carefull with the name you choose to create the pdf
回答5:
Please use proper destination path with PDF file name. Here is an example:
[xyz]$ wkhtmltopdf "https://www.google.co.in/?gfe_rd=cr\&ei=7n1LVeKNOMPCuAGDjoGACw\&gws_rd=ssl" /tmp/test/web/jj.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[xyz]$
来源:https://stackoverflow.com/questions/8881315/linux-permissions-issue-when-executing-wkhtmltopdf-amd64