简体   繁体   中英

Long standing while trying to create a PDF in PHP

I am using barryvdh/laravel-dompdf

$pdf = PDF::loadView('myview', $data);                      
//return $pdf->download('pdfview.pdf');                          
return $pdf->stream($nombre_archivo);

I am having a problem while trying to use the stream method $pdf->stream($nombre_archivo); my app keeps loading forever.

If i use the download method $pdf->download('pdfview.pdf'); works fine, but I need to use the stream method.

if you could help me, I will be very grateful.

Check the size of records in $data variable, if it has large amount of records the displaying may be slow or check the barryvdh/laravel-dompdf version and Laravel version, Sample code

public function export_pdf()
    {
        $pdf = PDF::loadHTML('<html><head></head><body>welcome to all</body></html>');
        return $pdf->stream('download.pdf');

    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM