How can I execute these two commands with php:
wkhtmltopdf www.google.com gg.pdf
&
oofice -headless -nologo -pt cup-pdf my.doc
both of them return a PDF file and are uploaded to my home directory.
I want to know how to execute this command from my html page via php.
Thanks.
You should familiarize yourself with the System program section: PHP provides several functions that can run external commands / programs, including:
exec()
shell_exec()
system()
To create a pdf file from php (on Linux) you must use a wrapper.
$cmd = '/usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/bin/wkhtmltopdf http://google.com /tmp/google.pdf'; exec($cmd);