assaqqaf
assaqqaf

Reputation: 1585

How to save Pdf file generated by ignited/laravel-pdf?

I use the ignited/laravel-pdf pacakges to convert the html into file. It convert the html file perfectly.

Unfortunatly, I didn't find a way to store the new file into my system.

I found only one method which are send();

Sample of my code:

$html = View::make('welcome', [])->render();
$pdf = PDF::make();
$pdf->addPage($html);

Upvotes: 0

Views: 1393

Answers (2)

$pdf->send ('filename.pdf');

Upvotes: 0

Magd Kudama
Magd Kudama

Reputation: 3459

The library is using the mikehaertl/phpwkhtmltopdflibrary. If you have a look at the source code, there's a method called saveAs() which sounds like what you're searching for. Have a look here: https://github.com/mikehaertl/phpwkhtmltopdf/blob/master/src/Pdf.php#L146

Upvotes: 2

Related Questions