creating pdf usiing kartik is not as intended

Hi guys,

following code creates pdf file. But file is not as it should be( look at my attachement to see, what’s not wanted!)

Any ideas, which options could avoid output beeing shown up in my attachement?

    public function actionPdf($id) {

        $model = $this->findModel($id);

        $providerEDateianhang = new \yii\data\ArrayDataProvider([

            'allModels' => $model->eDateianhang,


        $content = $this->renderAjax('_pdf', [

            'model' => $model,

            'providerEDateianhang' => $providerEDateianhang,


        $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_BROWSER,

            'content' => $content,


        return $pdf->render();


You will need to deactivate the debug mode, so the debug toolbar will not be rendered.


So, If U are right, in Releaseversion, PDF file will be created without unwanted content??

Please give feedback, if my assumption is correct!

Simply deactivate debugmode to check this out.

So, I did. Thanks for ur efforts helping me. I gave u reputation points…


This thread can be closed as succesfully solved