Fix odt as PDF generation
This commit is contained in:
parent
d6514e1cd6
commit
e6f9c567d9
@ -459,7 +459,8 @@ IMG;
|
|||||||
|
|
||||||
$name=str_replace('.odt', '', $name);
|
$name=str_replace('.odt', '', $name);
|
||||||
$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name;
|
$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name;
|
||||||
//dol_syslog('$execmethod='.$execmethod.' Run command='.$command);
|
|
||||||
|
dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command,LOG_DEBUG);
|
||||||
if ($execmethod == 1)
|
if ($execmethod == 1)
|
||||||
{
|
{
|
||||||
exec($command, $output_arr, $retval);
|
exec($command, $output_arr, $retval);
|
||||||
@ -486,16 +487,16 @@ IMG;
|
|||||||
|
|
||||||
if($retval == 0)
|
if($retval == 0)
|
||||||
{
|
{
|
||||||
//dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
|
dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
|
||||||
if (headers_sent($filename, $linenum)) {
|
if (headers_sent($filename, $linenum)) {
|
||||||
throw new OdfException("headers already sent ($filename at $linenum)");
|
throw new OdfException("headers already sent ($filename at $linenum)");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
/*if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
header('Content-type: application/pdf');
|
header('Content-type: application/pdf');
|
||||||
header('Content-Disposition: attachment; filename="'.$name.'.pdf"');
|
header('Content-Disposition: attachment; filename="'.$name.'.pdf"');
|
||||||
readfile("$name.pdf");
|
readfile("$name.pdf");
|
||||||
}
|
}*/
|
||||||
unlink("$name.odt");
|
unlink("$name.odt");
|
||||||
} else {
|
} else {
|
||||||
//dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
|
//dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ then
|
|||||||
pgrep -U `id -u` soffice
|
pgrep -U `id -u` soffice
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
|
soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless &
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
jodconverter "$1.odt" "$1.pdf"
|
jodconverter "$1.odt" "$1.pdf"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user