I merged multiple pdfs using fpdf, storing it locally to a path works fine. I want to skip storing and download the pdf straight from memory. I used the following in a service :
//All had the same outcome (returned pdf string to the browser *see imager)
$fpdf->Output( 'D', "filename.pdf")
$fpdf->Output( 'I', "filename.pdf")
$fpdf->Output( 'S')

Using:
- PHP 7.4
- Laravel 8
- setasign/fpdf (1.8.6)
- setasign/fpdi (v2.6.0)
I tried:
$fpdf->Output( 'F', "path/filename.pdf")
return response->download("path/filename.pdf")
$output = $fpdf->Output( 'S');
return Response::make($output, 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="merged.pdf"',
]);
same issue, it returns the pdf string to the browser.
When the response headers tell you,
then you are okay.