[*] PDF : You can now enable diskcache
This commit is contained in:
+11
-12
@@ -43,7 +43,7 @@ class PDFCore
|
||||
|
||||
public function __construct($objects, $template, $smarty)
|
||||
{
|
||||
$this->pdf_renderer = new PDFGenerator();
|
||||
$this->pdf_renderer = new PDFGenerator((bool)Configuration::get('PS_PDF_USE_CACHE'));
|
||||
$this->template = $template;
|
||||
$this->smarty = $smarty;
|
||||
|
||||
@@ -58,17 +58,17 @@ class PDFCore
|
||||
$this->pdf_renderer->setFontForLang('fr');
|
||||
foreach ($this->objects as $object)
|
||||
{
|
||||
$template = $this->getTemplateObject($object);
|
||||
if (!$template)
|
||||
continue;
|
||||
$template = $this->getTemplateObject($object);
|
||||
if (!$template)
|
||||
continue;
|
||||
|
||||
if (empty($this->filename))
|
||||
{
|
||||
$this->filename = $template->getFilename();
|
||||
if (count($this->objects) > 1)
|
||||
$this->filename = $template->getBulkFilename();
|
||||
}
|
||||
|
||||
if (empty($this->filename))
|
||||
{
|
||||
$this->filename = $template->getFilename();
|
||||
if (count($this->objects) > 1)
|
||||
$this->filename = $template->getBulkFilename();
|
||||
}
|
||||
|
||||
$template->assignHookData($object);
|
||||
|
||||
$this->pdf_renderer->createHeader($template->getHeader());
|
||||
@@ -82,7 +82,6 @@ class PDFCore
|
||||
|
||||
if ($render)
|
||||
$this->pdf_renderer->render($this->filename);
|
||||
|
||||
}
|
||||
|
||||
public function getTemplateObject($object)
|
||||
|
||||
@@ -44,9 +44,9 @@ class PDFGeneratorCore extends TCPDF
|
||||
public $font_by_lang = array('jp' => 'cid0jp');
|
||||
|
||||
|
||||
public function __construct()
|
||||
public function __construct($use_cache = false)
|
||||
{
|
||||
parent::__construct('P', 'mm', 'A4', true, 'UTF-8', false, false);
|
||||
parent::__construct('P', 'mm', 'A4', true, 'UTF-8', $use_cache, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ class PDFGeneratorCore extends TCPDF
|
||||
|
||||
/**
|
||||
* Change the font
|
||||
* @param unknown_type $iso_lang
|
||||
* @param string $iso_lang
|
||||
*/
|
||||
public function setFontForLang($iso_lang)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user