tcpdf output to file code example
Example 1: how to osave fpdf output to a file
$filename="/home/user/public_html/test.pdf";
$pdf->Output($filename,'F');
Example 2: genarate pdf in specific folder using tcpdf
$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');