Changing the default filename when using mPDF

前端 未结 3 1787
天命终不由人
天命终不由人 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

    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');
    

提交回复
热议问题