Add FIX_BROKEN_PDF to workaround an issue with PDFTK , it can not deal with all the PDF versions, we use
CONVERT to fix it first
This commit is contained in:
parent
ae0e218545
commit
8289422f27
2 changed files with 11 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ class Document_Export
|
|||
$cnt_feedback++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create a image with the stamp + formula
|
||||
$img = imagecreatefromgif(NOALYSS_INCLUDE . '/template/template.gif');
|
||||
|
|
@ -151,6 +151,13 @@ class Document_Export
|
|||
$stmt = CONVERT_GIF_PDF . " " . escapeshellarg($this->store_convert . '/' . 'stamp.gif') . " " . escapeshellarg($this->store_convert . '/stamp.pdf');
|
||||
passthru($stmt, $status);
|
||||
|
||||
//-----------------------------------
|
||||
// Fix broken PDF , actually pdftk can not handle all the PDF
|
||||
if ( define ('FIX_BROKEN_PDF') == 'YES' ) {
|
||||
$stmpt = CONVERT_GIF_PDF." ". escapeshellarg($this->store_convert . '/' . $file_pdf)." ". escapeshellarg($this->store_convert . '/' . $file_pdf.'tmp');
|
||||
passthru($stmpt,$status);
|
||||
rename ($this->store_convert . '/' . $file_pdf.'tmp',$this->store_convert . '/' . $file_pdf);
|
||||
}
|
||||
if ($status <> 0)
|
||||
{
|
||||
$this->feedback[$cnt_feedback]['file'] = 'stamp.pdf';
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ if ( !defined("NOALYSS_HOME")) define ("NOALYSS_HOME",dirname($dirname)."/html")
|
|||
if ( !defined("NOALYSS_PLUGIN")) define ("NOALYSS_PLUGIN",$g_ext_dir);
|
||||
if ( !defined("NOALYSS_INCLUDE")) define ("NOALYSS_INCLUDE",$g_include_dir);
|
||||
if ( !defined("NOALYSS_TEMPLATE")) define ("NOALYSS_TEMPLATE",$g_template_dir);
|
||||
// pdftk can deal with all the PDF , for some of them it is preferable to fix it
|
||||
// with convert
|
||||
if ( !defined("FIX_BROKEN_PDF")) define ("FIX_BROKEN_PDF",'NO');
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/constant.security.php';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue