i've used mpdf for dynamic pdf generation, PDF is working fine but in online server when i'm trying to preview the pdf in browser or download it to my pc , it shows "Unable to Load Pdf". I've also tried to check it into editor, i've not found any curropted error symbol.
Ob_clean(); // not working for me
here is my code:-
<?php
require_once 'vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('
<table style="text-align:center; background: '.$color1.'; color: '.$color2.'; width: 100%">
<tr>
<td style="width: 50%; font-size: 45px;">
HI,
</td>
</tr>
<tr>
<td style="width: 100%;">
<table style="width: 80%; border: 4px solid #fff;">
<tr>
<td>I am</td>
</tr>
<tr>
<td style="font-size: 32px;">'.$_POST['input1'].'</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100%;">
<table>
<tr>
<td style="font-size: 20px;">'.$_POST['input2'].'</td>
</tr>
</table>
</td>
</tr>
</table>
');
$file_name = "resume.pdf";
$mpdf->Output($file_name, 'I');
}
?>