我正在生成超过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分钟。
发布于 2020-01-03 22:19:32
通过使用wkhtmltopdf和a php wrapper to,我获得了更好的性能。
https://stackoverflow.com/questions/59544203
复制相似问题