J2.5 talk

Creating PDF views: Difference between revisions

From Joomla! Documentation

Mvangeest (talk | contribs)
m moved Talk:How to create PDF views to Talk:Creating PDF views: Adapted page title to the continuous tense used in most tutorial titles
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Has anyone tested this method on Joomla! 2.5?
Has anyone tested this method on Joomla! 2.5?
EDIT: tested on Joomla! 2.5 and working fine.
EDIT: tested on Joomla! 2.5 and working fine.
== Messy code in Chinese environment ==
I have tested this articel in my j25 site. Everything work fine.But when I want output some Chinese char to pdf file.
the page goes wrong. The Chinese char to be messy code.
I don't konw how to solve this.
You might need to install a Unicode font in DOMPDF (do a search on "dompdf unicode" for examples of how to do that
Also try this for the render function:
<source lang="php">
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();
$this->fullPaths($data);
$pdf->load_html($data);
$pdf->render();
$pdf->stream($this->getName() . '.pdf');
return '';
}</source>
:I'm sorry but J2.5 is EOS (End of Support) so any fixes for this issue will not be fixed. [[User:Tom Hutchison|Tom Hutchison]] ([[User talk:Tom Hutchison|talk]]) 08:07, 18 April 2015 (CDT)
Thanks very much!

Latest revision as of 10:41, 20 April 2015

Has anyone tested this method on Joomla! 2.5? EDIT: tested on Joomla! 2.5 and working fine.

Messy code in Chinese environment

I have tested this articel in my j25 site. Everything work fine.But when I want output some Chinese char to pdf file. the page goes wrong. The Chinese char to be messy code.

I don't konw how to solve this.

You might need to install a Unicode font in DOMPDF (do a search on "dompdf unicode" for examples of how to do that

Also try this for the render function:


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();
		$this->fullPaths($data);
		$pdf->load_html($data);
		$pdf->render();
		$pdf->stream($this->getName() . '.pdf');

		return '';
	}


I'm sorry but J2.5 is EOS (End of Support) so any fixes for this issue will not be fixed. Tom Hutchison (talk) 08:07, 18 April 2015 (CDT)

Thanks very much!