Laravel 5.1 - barryvdh/laravel-dompdf PDF Generation Error

5.5k views Asked by At

In my composer:

"barryvdh/laravel-dompdf": "0.6.*",

Here is My config/app Setup:

Providers Array:       'Barryvdh\DomPDF\ServiceProvider',

Aliases Array:          'PDF' => 'Barryvdh\DomPDF\Facade',

Here is My route Setup:

$pdf = App::make('dompdf.wrapper');

Route::get('/dompdf', function() {

$html='<p>Foo Bar</p>';

PDF::loadHTML($html)->setPaper('a4')
->setOrientation('landscape')
->setWarnings(false)
->save('myfile.pdf');

});

While I hit /dompdf url. I got this Error.

enter image description here

My another Question is if I want to use DOM PDF library in My Controller Method. What setup or Step I Need To Follow??

1

There are 1 answers

0
shavindip On

You can run the below command and try

composer require barryvdh/laravel-dompdf