I have been flowing this post to generate a pdf but the output is blank and there is no error displayed , i have put :
public function generate_pdf()
{
$this->load->library('mpdf');
$mpdf=new mPDF('utf-8','A4');
$mpdf->WriteHTML('<p>HTML content goes here...</p>');
$mpdf->Output();
}
When i put :
public function generate_pdf()
{
$this->load->library('mpdf');
$mpdf=new mPDF('utf-8','A4');
$mpdf->debug = true;
$mpdf->WriteHTML('<p>HTML content goes here...</p>');
$mpdf->Output();
}
referred to this answer , i get this error :
Output has already been sent from the script - PDF file generation aborted.
Some output is already sent to the browser from your script. Please check your source code. You may want to use output buffering as well.
it is working using ob_end_clean() that erase the output buffer and turn off output buffering