I would like to automate the export of the .odf file to .pdf .
I tried something called unoconv .
When you enter the Windows command prompt, everything is correct.
>"C:\Program Files (x86)\OpenOffice 4\program\python.exe" "C:\Program Files (x86)\OpenOffice 4\program\unoconv-master\unoconv" -f pdf path/to/myfile.odt
After using in a PHP script nothing works. The error does not appear.
exec('"C:\Program Files (x86)\OpenOffice 4\program\python.exe" "C:\Program Files (x86)\OpenOffice 4\program\unoconv-master\unoconv" -f pdf path/to/myfile.odt'); //or shell_exec('"C:\Program Files (x86)\OpenOffice 4\program\python.exe" "C:\Program Files (x86)\OpenOffice 4\program\unoconv-master\unoconv" -f pdf path/to/myfile.odt')
I also tried to avoid \ or use ' and " in a different way, but none of my tests were final.
$test = exec($cmd, $output, $return); echo var_dump($test); echo var_dump($output); echo var_dump($return);
Let me
//echo var_dump($test)give nothing //echo var_dump($ouput); array (size=0) empty //echo var_dump($return); int 1
This sounds like a permissions issue, but I also checked this and all folders are accessible for PHP.
source share