Problem with mpdf

Hi guys,

I try to generate a pdf with mpdf. In my local web hosting my code work well, but in my web hosting throw a exception. Can someone else help me to fix this?

PHP Notice – yii\base\ErrorException

Undefined offset: 16


        if (!class_exists('otl', false)) { include(_MPDF_PATH.'classes/otl.php'); }

        if (empty($this->otl)) { $this->otl = new otl($this); }

        $this->otl->_bidiPrepare($arrayaux, $blockdir);

        $array_size = count($arrayaux);

    }

 

 

    // Remove empty items // mPDF 6

    for($i=$array_size-1; $i > 0; $i--) {

        if (empty($arrayaux[$i][0]) && $arrayaux[$i][16]!=='0' && empty($arrayaux[$i][7])) {

            unset($arrayaux[$i]);

        }

    }

 

    // Correct adjoining borders for inline elements

    if (isset($arrayaux[0][16])) { $lastspanborder = $arrayaux[0][16]; }

    else { $lastspanborder = false; }

    for($i=1;$i < $array_size; $i++) {

        if (isset($arrayaux[$i][16]) && $arrayaux[$i][16]==$lastspanborder &&

Maybe:




if (empty($arrayaux[$i][0]) && (isset($arrayaux[$i][16]) && $arrayaux[$i][16]!=='0') && empty($arrayaux[$i][7])) {



P.S: your coding style is very much off, you should follow a standard…

this is not my own code, is from the library kartiv mpdf.

(isset($arrayaux[$i][16]) that works , thanks.

I will report this issue in kartik repository also.

You probably should report this to the kartik repository?