Fix create temp dir

This commit is contained in:
Laurent Destailleur 2021-01-26 16:33:47 +01:00
parent 1637b6af7d
commit 69344a7170

View File

@ -820,11 +820,13 @@ IMG;
// Export to PDF using LibreOffice
if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice')
{
dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable
// Install prerequisites: apt install soffice libreoffice-common libreoffice-writer
// using windows libreoffice that must be in path
// using linux/mac libreoffice that must be in path
// Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1
$command ='soffice --headless -env:UserInstallation=file:"//'.$conf->user->dir_temp.'" --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
$command ='soffice --headless -env:UserInstallation=file:\''.$conf->user->dir_temp.'\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
}
elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF))
{