unplugngo
unplugngo

Reputation: 175

Newbie - Blank pdf using CodeIgniter and mPDF

I'm new to CodeIgniter and even newer to mPDF and I'm having some brain trouble in trying to create a single-page invoice from an existing View. Code is as follows:

$this->load->library('mpdf');

$to_convert = $this->load->view('test_pdf_view',TRUE);

$this->mpdf->WriteHTML($to_convert);

$this->mpdf->Output();

Any help would be greatly appreciated.

Thank you :-)

Upvotes: 0

Views: 790

Answers (1)

Yan Berk
Yan Berk

Reputation: 14428

You need to pass TRUE as the third parameter to the view:

$to_convert = $this->load->view('test_pdf_view', NULL, TRUE);

Upvotes: 2

Related Questions