Search code examples
wkhtmltopdf

wkhtml library is not accepting second parameter in url?


I am using wkhtml library for html to pdf generation but it is not accepting second parameter in url?

exec('C://"Program Files"//wkhtmltopdf.exe ' . 'http://localhost/test.php?a=351&b=2' . ' ' . $file_name . '');

Is any idea?


Solution

  • Try to set the command to a variable, echo it and try it out directly on the executable, not from PHP. That might give you a readable error.

    Also, try to put the url in quotes, I just tried the following command and it worked nicely

    wkhtmltopdf.exe "https://www.google.com/search?hl=fi&safe=off&biw=1195&bih=732&site=imghp&tbm=isch&sa=1&q=test&oq=test" test.pdf