TCPDF 将文件保存到文件夹?
我正在使用TCPDF打印收据,然后使用phpMailer将其发送给客户,但我遇到了一个问题:
我不知道如何将文件保存到pdf中。
我试过这个:
// reset pointer to the last page
$pdf->lastPage();
//Close and output PDF document
$pdf->Output('kuitti'.$ordernumber.'.pdf', 'I');
$this->Output("kuitit");
我正在使用TCPDF打印收据,然后使用phpMailer将其发送给客户,但我遇到了一个问题:
我不知道如何将文件保存到pdf中。
我试过这个:
// reset pointer to the last page
$pdf->lastPage();
//Close and output PDF document
$pdf->Output('kuitti'.$ordernumber.'.pdf', 'I');
$this->Output("kuitit");
试试这个
$pdf->Output('kuitti'.$ordernumber.'.pdf', 'F');
这会将生成的pdf文件存储在项目的自定义文件夹中
$filename= "{$membership->id}.pdf";
$filelocation = "D:\\wamp\\www\\project\\custom";//windows
$filelocation = "/var/www/project/custom"; //Linux
$fileNL = $filelocation."\\".$filename;//Windows
$fileNL = $filelocation."/".$filename; //Linux
$this->pdf->Output($fileNL, 'F');