I\'m using TCPDF to print a receipt and then send it to customer with phpMailer, but I have a problem:
I have no idea how to save the file into a pdf.
TCPDF uses fopen() to save files. Any paths passed to TCPDF's Output() function should thus be an absolute path.
Output()
If you would like to save to a relative path, use e.g. the __DIR__ global constant (see this answer).
__DIR__