J2.5 talk

Difference between revisions of "Creating PDF views"

From Joomla! Documentation

(Created page with "Has anyone tested this method on Joomla! 2.5?")
 
 
(6 intermediate revisions by 5 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.
 +
 +
== 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 05: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[edit]

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!