I\'m going to generate a PDF report using FPDF library, but the output is blank. There is no error displayed, how can I fix this problem?
Anyway, I tried this code in
I had the same problem and this was my solution:
Instead of using
$this->fpdf =new FPDF()
I used
$pdf = new FPDF();
then u can use $pdf->... and not $this->pdf->...
Here is an example:
define('FPDF_FONTPATH',$this->config->item('fonts_path'));
$this->load->library(array('fpdf','fpdf_rotate','pdf'));
$this->pdf->Open();
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial', '', 12);
$pdf->SetDrawColor(0);
$pdf->MultiCell(100,5,"Test\n line of text");
$pdf->Output('test.pdf', 'D');
Works like a charm ;)