kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

Undefined Index: current #110

Closed skills-up closed 3 years ago

skills-up commented 3 years ago

Hello,

I've been repeatedly getting the following error after updating from BS3.x version to BS4 version.

Undefined index: current in @vendor/mpdf/mpdf/src/Tag/BlockTag.php:316

The calling mechanism is as below:

    $pdf = new \kartik\mpdf\Pdf([
            'mode' => \kartik\mpdf\Pdf::MODE_CORE,
            'format' => \kartik\mpdf\Pdf::FORMAT_A4,
            'orientation' => \kartik\mpdf\Pdf::ORIENT_PORTRAIT,
            'destination' => \kartik\mpdf\Pdf::DEST_FILE,
            'filename' => $path,
            'content' => $content,
            'cssFile' => '@vendor/kartik-v/yii2-mpdf/src/assets/kv-mpdf-bootstrap.min.css',
            'cssInline' => "body{font-family:Arial, Helvetica, sans-serif} div.block{;page-break-inside:avoid;page-break-before:auto} table{border:.1em solid #EEE;width:100%;margin-bottom:1em;font-size:1.1em} caption{background:#EEE;font-size:1.2em;color:#000;padding:.5em;text-align:left} table.headline caption{background:#FC3} table.headline td, table.flights td{text-align:center} th, td{padding:.5em;text-align:left} tr:nth-child(n+2){border-top:.1em dashed #EEE} img.logo{max-width:50px} th.fare, td.fare{text-align:right} h5{font-weight:bold} tr.highlight{background:#EEE}",
            'options' => ['title' => \Yii::$app->name],
        ]);

I'm using PHP 7.4.x on my server, and it looks like older mpdf versions are not compatible to the latest version, so a downgrade is not possible either.

Could you please let me know if there is some configuration change which is required here?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.