mpdf yii2抛出错误未定义偏移量:tableLevel为0

时间:2019-07-10 08:01:28

标签: yii2 mpdf kartik-v

我正在使用kartik-v / yii2-mpdf v1.0.5,只是将html内容打印到pdf中。

但是最近我开始遇到问题,无需更改代码

我的代码:

$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_BROWSER,
    // your html content input
    'content' => $content,
    // format content from your own css file if needed or use the
    // enhanced bootstrap css built by Krajee for mPDF formatting 
    'cssFile' => '@vendor/kartik-v/yii2-mpdf/src/assets/kv-mpdf-bootstrap.min.css',
    // any css to be embedded if required
    'cssInline' => '.kv-heading-1{font-size:18px}',
    // set mPDF properties on the fly
    'options' => ['title' => $pdfTemplate->name],
    // call mPDF methods on the fly
    'methods' => [
        'SetHeader' => [$pdfTemplate->name],
        'SetFooter' => ['{PAGENO}'],
    ]
]);

return $pdf->render();

enter image description here

0 个答案:

没有答案