Merge pull request #8201 from BitKFu/develop

Export to PDF using LibreOffice 5 command line
This commit is contained in:
Laurent Destailleur 2018-02-15 17:30:22 +01:00 committed by GitHub
commit c022b082d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,18 +581,10 @@ IMG;
// Export to PDF using LibreOffice // Export to PDF using LibreOffice
if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice')
{ {
// Executing convert to PDF using libreoffice 5 // using windows libreoffice that must be in path
if (isset($_SERVER["WINDIR"])) // using linux/mac libreoffice that must be in path
{ // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1
// using windows libreoffice that must be in path $command ='soffice -headless -convert-to pdf -outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
// Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1
$command ='soffice.exe -headless -convert-to pdf -outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
}
else
{
// using linux/mac libreoffice that must be in path
$command ='soffice -headless -convert-to pdf -outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
}
} }
elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF))
{ {