Possible Duplicate:
How do I get WKHTMLTOPDF to execute via PHP?
I am using Wkhtmltopdf, Windows OS, Xampp to convert HTML into A4 PDF documents from the command line. This works fine. But how can I achieve this in PHP? The Windows command I use is:
D:\Program Files\wkhtmltopdf>wkhtmltopdf.exe http://www.google.com E:/d.pdf
PHP provides multiple methods for running an external command-line string.
shell_exec()system()exec()passthru()Which one you should use depends on exactly what you want to do — ie whether you need to get a result back from the command to your PHP code or not; whether you want to output the result to the browser; whether you want the PHP program to wait for the external code to finish or not before proceeding…
You’ll need to read the manual pages linked above to decide which of the options is best suited to your needs.
Hope that helps.