0

hello good evening I have a problem when trying to send a pdf union from phpmailer that I use with the FPDI and FPDF library.

$filename = "example.pdf";
$document = $pdf->Output($filename, 'S');
$printpdf = merge($folders,$filename);

This line currently works for me as well as I have it $mail->AddStringAttachment($document, $filename);

but when I try to pass the variable $printpdf where it does the union of the pdfs, I don't know if I'm passing the parameters wrong here is the example $mail->AddStringAttachment($printpdf, $filename);

1 Answers1

0

It looks like you have some wrong syntax for fpdf. The Output method has this signature:

string Output([string dest [, string name [, boolean isUTF8]]])

and it says that all but the first is ignored in S mode. So if you want the PDF as a string, you need:

$document = $pdf->Output('S');

That should then work if you pass it into addStringAttachment as you describe. I've no idea what your merge function is.

Synchro
  • 35,538
  • 15
  • 81
  • 104