I want to use wkhtmltopdf to convert a web page to a PDF file. I have a test with a static template and this syntax works perfectly:
wkhtmltopdf my.html my.pdf
The problem is the actual page is a dynamic PHP page with tables that rely on three HTML GET variables.
An example would be:
http://mypage.php?clientid=SJC&datestart=201201&dateend=201202
I can’t do this directly like so:
wkhtmltopdf mypage.php?clientid=SJC&datestart=201201&dateend=201202 my.pdf
Someone suggested I needed to call the PHP from the command line with the variables first to get the HTML source code for that set of variables, and convert it using wkhtmltopdf.
How do I do this? What is the process using the above URL as an example?
In Linux you can use the wget command to get a result HTML file from an URL:
Or
to output the result to specific file, for example, myfile.html
Note:
Double quote seems to solve the ampersand encoding problem.