Hello,
i use the kartik/mpdf extensions to generate PDF Docs. But the generated File can not view in Browsers or Acrobat Reader. What is wrong? Can anyone help me?
$content="<h1>Test</h1>";
$pdf = new Pdf([
'mode' => 'utf-8',
'format' => 'A4',
'orientation' => 'P',
'filename' => 'test.pdf',
'destination' => 'F',
'content' => $content
]);
$pdf->output($pdf->content, $pdf->filename, 'D');
evstevemd
(Stefano Mtangoo)
July 5, 2022, 8:18am
2
Try the MPDF package directly. It removes one layer in your troubleshooting plus you have a guarantee it is latest version
Thank you very much. I use now
$pdf = Yii::$app->pdf;
$pdf->content = $htmlContent;
return $pdf->render();
This works fine…
evstevemd
(Stefano Mtangoo)
July 7, 2022, 5:30pm
4
Is it from MPDF or Kartik’s package?
How do you configure pdf
component?
It’s Kartik’s package. But now i have a solution found that work. Thank you anyway.