Fix: broken $pdf object !

This commit is contained in:
Regis Houssin 2018-04-14 10:41:38 +02:00
parent fea3182e93
commit d97c052d08
2 changed files with 8 additions and 6 deletions

View File

@ -130,6 +130,10 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
//$format=array($arrayformat['width'],$arrayformat['height']);
//$metric=$arrayformat['unit'];
if (class_exists('TCPDI')) $pdf = new TCPDI($pagetype,$metric,$format);
else if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
// Protection and encryption of pdf
if (! empty($conf->global->PDF_SECURITY_ENCRYPTION))
{
@ -144,9 +148,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
- print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
- owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
*/
if (class_exists('TCPDI')) $pdf = new TCPDI($pagetype,$metric,$format);
else if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
// For TCPDF, we specify permission we want to block
$pdfrights = array('modify','copy');

View File

@ -108,7 +108,7 @@ class pdf_crabe extends ModelePDFFactures
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "bills"));
@ -204,7 +204,7 @@ class pdf_crabe extends ModelePDFFactures
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
// Translations
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
@ -1543,7 +1543,7 @@ class pdf_crabe extends ModelePDFFactures
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf, $langs;
// Translations
$outputlangs->loadLangs(array("main", "bills", "propal", "companies"));