Changing the default filename when using mPDF

前端 未结 3 1756
天命终不由人
天命终不由人 2021-01-03 23:56

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

3条回答
  •  执念已碎
    2021-01-04 00:45

    You can try as:

    $file_name = 'yourFileName.pdf';
    $mpdf->Output($file_name, 'D');
    

    Help:

    1. 'D': download the PDF file
    2. 'I': serves in-line to the browser
    3. 'S': returns the PDF document as a string
    4. 'F': save as file $file_out

提交回复
热议问题