Any error stating 'TCPDF' means that there was a problem with the generation of the PDF file.
try this
$pdf->Output('kuitti'.$ordernumber.'.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');
$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')
Only thing that worked for me:
// save file
$pdf->Output(__DIR__ . '/example_001.pdf', 'F');
exit();
For who is having difficulties storing the file, the path has to be all the way through root. For example, mine was:
$pdf->Output('/home/username/public_html/app/admin/pdfs/filename.pdf', 'F');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With