I'm attempting to use either mPDF or TCPDF, whichever is easier, to generate a PDF and then send it somewhere using FTP.
I cannot figure out how to assign a PDF to a variable so that I can then save the PDF as a file across FTP.
Here's an example of what I'm trying to do that doesn't work:
include("../mpdf60/mpdf.php");
$mpdf = new mPDF();
$mpdf->WriteHTML('<p>Hello World!</p>');
$generatedPDF = $mpdf->Output('', 'S');
// ...connect to ftp...
if (ftp_put($conn_id, 'test.pdf', $generatedPDF, FTP_BINARY)) {
$debug['ftp_FILECREATEsuccess'] = 'true';
} else {
$debug['ftp_FILECREATEsuccess'] = 'false';
}
$debug:
["ftp_FILECREATEsuccess": false]
Note: If there are better php class systems for doing what I'm trying to do, please let me know.