TCPDF Save file to folder?
try this
$pdf->Output('kuitti'.$ordernumber.'.pdf', 'F');
$pdf->Output()
takes a second parameter $dest
, which accepts a single character. The default, $dest='I'
opens the PDF in the browser.
Use F
to save to file
$pdf->Output('/path/to/file.pdf', 'F')
this stores the generated pdf file in your custom folder of your project
$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');