1
I want to download a PDF of 1000s of records in a table view using mpdf extension in yii framework. I have almost 50,000 rows. I got 3000 rows data in pdf but when record increases, it takes too much time and finally get time out error.
I also use this but it's not working for me:
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', '0');
Steps to generate pdf:
set
$mpdf = Yii::app()->ePdf->mpdf('utf-8', 'A4'); $mpdf->ignore_invalid_utf8 = true; $stylesheet = file_get_contents(Yii::getPathOfAlias('webroot') . '/themes/repairdesk/css/pdf.css'); /// here call you external css file $mpdf->WriteHTML($stylesheet, 1);
render view
and pass in it
$mpdf->WriteHTML($content,0); $mpdf->Output('Sales by item-' . time() . '.pdf', 'D'); exit;
I am totally new in yii and stack overflow