I generated a PDF using the dompdf library and used this:
$dompdf->stream('my.pdf',array('Attachment'=>0));
to force the browser to let the user view the PDF before downloading. But it's not working. A Google search isn't bringing up any answers either. Can anyone help?
Try using the below code. Let me know are you create data from form or html file data.
$dompdf->stream("dompdf_out.pdf", array("Attachment" => false));
exit(0);
If someone still looking for answer and it's still not resolved, try installing and turning on the PDF Viewer / PDF JS extension in the browser.
After adding parameter array(“Attachment”=>0)
or array(“Attachment”=>false)
to the stream and still not working. It's because your browser doesn't have a pdf reader available/activated. Installing and activating browser extension like PDF Viewer / PDFJS will force the browser to read and review the pdf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With