I need to do 2 things together & at the same time with DOMPDF.
I need to do the following together - is this possible?
//print the pdf file to the screen for saving
$dompdf->stream("pdf_filename_".rand(10,1000).".pdf", array("Attachment" => false));
//save the pdf file on the server
file_put_contents('/home/stsnew/public_html/pdf/file.pdf', $dompdf->output());
The above works fine if $dompdf->stream
and $dompdf->output()
are done separately/individually , but when I try to run them together as shown above, it just crashes.
Any help/advice would be really appreciated.