diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 7b165b53142..0f5861caf68 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -821,7 +821,10 @@ 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 + + // We delete and recreate a subdir because the soffice may have change pemrissions on it + dol_delete_dir_recursive($conf->user->dir_temp.'/odtaspdf'); + dol_mkdir($conf->user->dir_temp.'/odtaspdf'); // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer // using windows libreoffice that must be in path