[*] PDF : PDF could now be returned as a string

This commit is contained in:
fBrignoli
2011-12-22 10:54:58 +00:00
parent 1b0f88866b
commit 37a01c2d0d
3 changed files with 10 additions and 6 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ class PDFCore
$this->objects = array($objects);
}
public function render()
public function render($display = true)
{
$render = false;
$this->pdf_renderer->setFontForLang('fr');
@@ -81,7 +81,7 @@ class PDFCore
}
if ($render)
$this->pdf_renderer->render($this->filename);
return $this->pdf_renderer->render($this->filename, $display);
}
public function getTemplateObject($object)
+5 -2
View File
@@ -121,15 +121,18 @@ class PDFGeneratorCore extends TCPDF
* Render the pdf file
*
* @param string $filename
* @param boolean $inline
* @throws PrestashopException
*/
public function render($filename)
public function render($filename, $display = true)
{
if (empty($filename))
throw new PrestashopException('Missing filename.');
$this->lastPage();
$this->output($filename, 'I');
$output = $display ? 'I' : 'S';
return $this->output($filename, $output);
}
/**