Welcome Guest, Not a member yet? Register   Sign In
Download html view in pdf
#5

[eluser]Zorancho[/eluser]
fixed it this way:

$data['something'] = $this->Model->get_something();
$this->load->library('pdf'); //This is from the wiki the integration library.
$this->pdf->SetSubject('Subject');
$this->pdf->AddPage();
$this->pdf->SetFont('freeserif', '', 12); //This font supports serbian latin.
$html = $this->parser->parse('some_view', $data); //I have parser class loaded previously
//I tried loading a view, but it didn't work. Also tcpdf hates characters like <br/>
$this->pdf->writeHTML($html, true, 0, true, 0);
$this->pdf->lastPage();
ob_end_clean(); //I had to use this, otherwise it produces error about the headers being sent already.
$this->pdf->Output('File.pdf', 'I');

Hope someone finds it helpful. If you want more help, send me private message.
Thanks again for the help and pointing out the TCPDF.


Messages In This Thread
Download html view in pdf - by El Forum - 05-23-2009, 07:32 AM
Download html view in pdf - by El Forum - 05-23-2009, 09:57 AM
Download html view in pdf - by El Forum - 05-23-2009, 10:45 AM
Download html view in pdf - by El Forum - 05-23-2009, 10:48 AM
Download html view in pdf - by El Forum - 05-23-2009, 09:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB