blank pdf attachment sent using FPDF and SwiftMailer
问题 I am trying to create a PDF stream using FPDF library and to send the pdf over e-mail using Swift Mailer. Below is my code. The mail is sent successfully and even pdf is also attached but the pdf is blank. It has a size of 1Kb and can be opened as a pdf. My code is : <?php include('./fpdf/fpdf.php'); require_once './lib/swift_required.php'; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Text(40, 10, "Dummy text"); $data=$pdf->Output('./emails/order.pdf', 'F');