View pdf without downloading using dompdf

I created a PDF file using the dompdf library and used this:

$dompdf->stream('my.pdf',array('Attachment'=>0)); 

to force the browser to allow the user to view the PDF before downloading. But that does not work. Google search also gives no answers. Can anyone help?

+11
source share
3 answers

Try using the code below. Let me know that you are creating data from forms or html files.

 $dompdf->stream("dompdf_out.pdf", array("Attachment" => false)); exit(0); 
+32
source

Works on a local server but does not work on a real server

0
source

When I try to execute a stream, as mentioned above, I get a blank page instead of the generated pdf file (note: the pdf file is present on the server .. but not displayed)

0
source

Source: https://habr.com/ru/post/972226/


All Articles