I would like to automate the exportation of .odf
file to .pdf
.
I tried something called unoconv.
When typed in the Windows command prompt, everything is right.
>"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
Once used in a PHP script, nothing works anymore. No error appears.
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 escape \
or using '
and "
differently but none of my tests were conclusive.
$test = exec($cmd, $output, $return);
echo var_dump($test);
echo var_dump($output);
echo var_dump($return);
Give 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 the folders are accessible for PHP.