Kartik DEST_FILE yii2
<p>Please I am having a problem trying to save a generated pdf file to a tmp folder using Kartik.
I have used the code but nothing seems to work, this a snippet of my code.
Thanks.</p>

<pre><code>$content = $this-&gt;renderPartial('sertifikat', [
    'model' =&gt; $model,
    'bal' =&gt; $bal,
    'derece' =&gt; $derece,
]);

// setup kartik\mpdf\Pdf component
$pdf = new Pdf([
    // set to use core fonts only
    'mode' =&gt; Pdf::MODE_CORE,

    // A4 paper format
    'format' =&gt; Pdf::FORMAT_A4,

    // portrait orientation
    'orientation' =&gt; Pdf::ORIENT_PORTRAIT,

    // stream to browser inline
    'destination' =&gt; Pdf::DEST_FILE,
    'filename' =&gt; Url::to(['generate/report']),
    'tempPath' =&gt; '/generatedFolder',

    // your html content input
    'content' =&gt; $content,

    // format content from your own css file if needed or use the
    // enhanced bootstrap css built by Krajee for mPDF formatting
    'cssFile' =&gt; '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',

    // any css to be embedded if required
    'cssInline' =&gt; '.kv-heading-1{font-size:18px}',

    // set mPDF properties on the fly
    'options' =&gt; ['title' =&gt; 'Krajee Report Title'],

    // call mPDF methods on the fly
    'methods' =&gt; [
        'SetHeader'=&gt;['Krajee Report Header'],
        'SetFooter'=&gt;['{PAGENO}'],
    ]
]);

// return the pdf output as per the destination setting
return $pdf-&gt;render();
</code></pre>