在kartik-v/yii2 mpdf中生成超过100页的PDF

在kartik-v/yii2 mpdf中生成超过100页的PDF,yii2,yii2-advanced-app,mpdf,Yii2,Yii2 Advanced App,Mpdf,我正在生成超过100页的PDF。但生成PDF需要3-5分钟。我想把时间延长到1分钟 use kartik\mpdf\Pdf; $header = getPDFHeader(); $body = getPDFBody(); $pdf = new Pdf([ // set to use core fonts only 'mode' => Pdf::MODE_CORE,

我正在生成超过100页的PDF。但生成PDF需要3-5分钟。我想把时间延长到1分钟

    use kartik\mpdf\Pdf;
    $header = getPDFHeader();
    $body =  getPDFBody();
    $pdf = new Pdf([
                // set to use core fonts only
                'mode' => Pdf::MODE_CORE, 
                // A4 paper format
                'format' => Pdf::FORMAT_A4, 
                // portrait orientation
                'orientation' => Pdf::ORIENT_PORTRAIT, 
                // stream to browser inline
                'destination' => Pdf::DEST_DOWNLOAD, 
                // your html content input
                'content' => $body,  
                // format content from your own css file if needed or use the
                // enhanced bootstrap css built by Krajee for mPDF formatting 
                'cssFile' => '../../frontend/web/css/pdf.css',
                // set mPDF properties on the fly
                'options' => ['title' => 'Krajee Report Title'],
                 // call mPDF methods on the fly
                'methods' => [ 
                    'SetFooter'=>['{PAGENO}'],
                ]
                ]);
$pdf->render();

我是yii2的新手。我只想在不到1分钟内生成它。我缺少什么样的设置?最多需要5分钟。

我使用and获得了更好的性能。

我相信您在代码中对此无能为力。由于您的pdf文档很大,服务器需要花费大量时间来处理它。您可以做的是增加服务器的处理能力和内存等。否则,您可以要求mpdf的开发人员优化内部扩展代码,以更快地生成pdf文档。