Open ijohnson-TCR opened 1 year ago
I would also like to mention, I have added OfficeToPDF.exe to my path, and I've also tried shell_exec()
and system()
commands which both give the same error.
Same issue here though I'm trying to use OfficeToPdf on a remote computer using Jenkins.
Works perfectly in local but I have the same error when remoting
I think some how you have to run officeToPdf like SYSTEM user. When you run it from console with your windows user it runs ok, no? When you run it from the web your System user is running the script. Try logging the user when you run it:
"Current user: " . get_current_user()
or
"Current user: " . exec('whoami')
With this command:
exec('OfficeToPDF.exe {path}\TEST.docx {path}\TEST.pdf /verbose', $output);
I get this value for$output
:And the file does not convert.
However, when running this command directly from CMD or powershell:
OfficeToPDF.exe {path}\TEST.docx {path}\TEST.pdf /verbose
It works perfectly. What am I doing wrong?