I am working with mPDF, I can't handle how to display php variable and generate&download PDF file. Example :
$a = '<head><body>Example</body></head>';
echo $a;
$mpdf = new mPDF();
$mpdf->WriteHTML('<head><body>Example</body></head>');
$mpdf->Output('filename.pdf', 'D');
This code only downloading pdf generated from ->WriteHTML but not displaying code above. I would display code and download pdf. Thx for tips.