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();
}