diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index bc15530a777..7b165b53142 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -821,12 +821,13 @@ IMG; if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') { dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable + dol_mkdir($conf->user->dir_temp.'/odtaspdf'); // We create a subdir because the soffice change pemrissions on it // 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.'/odtaspdf\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); } elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) {