Ejemplo n.º 1
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return	string
  */
 public function render($cache = false, $params = array())
 {
     // mb_encoding foo when content-type had been set to text/html; uft-8;
     $this->_metaTags['http-equiv'] = array();
     $this->_metaTags['http-equiv']['content-type'] = 'text/html';
     // Testing using futural font.
     // $this->addStyleDeclaration('body: { font-family: futural !important; }');
     $pdf = $this->engine;
     $data = parent::render();
     FabrikPDFHelper::fullPaths($data);
     $pdf->load_html($data);
     $config = JComponentHelper::getParams('com_fabrik');
     if ($config->get('pdf_debug', true)) {
         return $pdf->output_html();
     } else {
         $pdf->render();
         $pdf->stream($this->getName() . '.pdf');
     }
     return '';
 }
Ejemplo n.º 2
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return	string
  */
 public function render($cache = false, $params = array())
 {
     // mb_encoding foo when content-type had been set to text/html; uft-8;
     $this->_metaTags['http-equiv'] = array();
     $this->_metaTags['http-equiv']['content-type'] = 'text/html';
     // Testing using futural font.
     // $this->addStyleDeclaration('body: { font-family: futural !important; }');
     $pdf = $this->engine;
     $data = parent::render();
     FabrikPDFHelper::fullPaths($data);
     /**
      * I think we need this to handle some HTML entities when rendering otherlanguages (like Polish),
      * but haven't tested it much
      */
     $data = mb_convert_encoding($data, 'HTML-ENTITIES', 'UTF-8');
     $pdf->load_html($data);
     $config = JComponentHelper::getParams('com_fabrik');
     if ($config->get('pdf_debug', true)) {
         return $pdf->output_html();
     } else {
         $pdf->render();
         $pdf->stream($this->getName() . '.pdf');
     }
     return '';
 }