Speaktech.in

add a watermark with Yii2 kartik-mpdf

add a watermark with Yii2 kartik-mpdf



 $HTML='your html content';    $mpdf =new \Mpdf\Mpdf();//please use your kartik mpdf object here     $mpdf->SetWatermarkImage('../images/background.jpg');    $mpdf->showWatermarkImage =true;    $mpdf->WriteHTML($HTML);// Saves file on the server as 'filename.pdf'   $mpdf->Output('filename.pdf', \Mpdf\Output\Destination::FILE);