I\'m currently using mPDF to generate a pdf from HTML (which was generated by PHP).
All works as expected but I\'d like to be able to change the default filename. C
Modify mdpdf.php
form.setAttribute("action", "'._MPDF_URI.'includes/out.php/'.$name.'");
for downloading with other name
Try the I
flag in the Output
function, which will output the PDF to the browser, and use the filename from the first argument:
$payStub=new mPDF();
$payStub->SetTitle('My title');
$payStub->WriteHTML($pcTableRows);
$payStub->Output('yourFileName.pdf', 'I');
You can try as:
$file_name = 'yourFileName.pdf';
$mpdf->Output($file_name, 'D');
Help: