How to download large PDF like 1000 of pages using yii mpdf extension

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:

  1. 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);
    
  2. render view

  3. 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

user989899

Posted 2019-01-25T13:38:19.010

Reputation: 11

No answers