I am trying to convert html documents to pdf's using wkhtmltopdf. The command that I would use on linux: wkhtmltopdf 15.52579.html 15.52579.pdf.
This first outputs something like Loading pages (1/6) [> ] 0% [=====, loads to 100% and then shows:
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
I want php to execute this command. I've tried to use php's exec("wkhtmltopdf 15.52579.html 15.52579.pdf") and shell_exec("wkhtmltopdf 15.52579.html 15.52579.pdf"), both with and without capturing stderr by adding 2>&1. I've also tried proc_open functions.
Everytime, my result is Loading pages (1/6) [> ] 0% [======> ] 10%. It looks like the command returns too soon, not allowing the program to finish and actually create the pdf.
The user that php is running under has the correct permissions to execute the program. Script is executed by a webpage, and should finish in matters of seconds. What am I missing?