lundi 4 avril 2022

Error while creating PDF from DomPDF, Call to a member function stream() on string

Trying to create PDF from HTML and storing it to AWS bucket in Laravel using Barryvdh\DomPDF. It works fine, the pdf is created and is stored to aws bucket but getting error , Call to a member function stream() on string.

All this process is called through a queue job, the error response is saved to failed_jobs table in exception field in DB.

Below is the snippet code used.

$fileName = "anyfilename.pdf"
$html = \View::make('frontend.courses.certificate', [
    'course'     => "This is test course",
])->render();

$pdf = \PDF::setPaper('a4', 'landscape')->loadHtml($html);
\Storage::disk('s3')->put($s3Path, $pdf->stream($fileName)->getContent());

I have tried everything what came to my mind to solve this but nothing works. Any suggestions how to bebug this or any fix for this.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/i9It4mV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire