Naming and Storing the file

171 views
Skip to first unread message

Anushaath .P

unread,
Apr 7, 2017, 7:00:00 AM4/7/17
to dompdf


How do I name a specific file?
Also I want to store the generated PDF in the webserver instead of downloading it. How do i do that?

BrianS

unread,
Apr 11, 2017, 6:21:16 PM4/11/17
to dompdf
If you're streaming the file you just specify the name when you stream.

$dompdf->stream('render.pdf');

If you want to save the file to your server you use the output method to capture the PDF source into a variable. You can then place the file on your server using standard PHP file writing method.

$pdf = $dompdf->output();
file_put_contents
('render.pdf', $pdf);
Reply all
Reply to author
Forward
0 new messages