Browse PDF files without downloading, using dompdf
P粉541796322
P粉541796322 2023-08-27 21:37:21
0
2
471
<p>I generated a PDF using the dompdf library and used this: </p> <pre class="brush:php;toolbar:false;">$dompdf->stream('my.pdf',array('Attachment'=>0));</pre> <p>Force the browser to let users view the PDF before downloading. But this doesn't work. A Google search didn't give any answers either. Can anyone help? </p>
P粉541796322
P粉541796322

reply all(2)
P粉878510551

If anyone is still looking for an answer and it still doesn't solve the problem, try installing and opening the PDF Viewer/PDF JS extension in your browser.

After adding the parameter array("Attachment"=>0) or array("Attachment"=>false) to the stream, it still doesn't work. . This is because your browser does not have a pdf reader available/activated. Installing and activating browser extensions such as PDF Viewer / PDFJS will force the browser to read and review pdfs.

P粉473363527

Try using the code below. Let me know if you are creating the data from form or html file data.

$dompdf->stream("dompdf_out.pdf", array("Attachment" => false));

exit(0);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!