dev-master
9999999-devLaravel Pdf package
MIT
The Requires
- php >=5.3.0
- illuminate/support 4.x
- dompdf/dompdf 0.6.x
by David Haska
laravel pdf dompdf
Laravel Pdf package
Provider:, (*1)
'Haska\Pdf\PdfServiceProvider',
Alias:, (*2)
'PDF' => 'Haska\Pdf\Facade',
Config:, (*3)
php artisan config:publish haska/laravel-pdf
You can create a new DOMPDF instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download., (*4)
$pdf = App::make('dompdf'); $pdf->loadHTML('<h1>Test</h1>'); return $pdf->stream();
Or use the facade:, (*5)
$pdf = PDF::loadView('pdf.invoice', $data); return $pdf->download('invoice.pdf');
You can chain the methods:, (*6)
return PDF::loadFile(public_path().'/myfile.html')->save('/path-to/my_stored_file.pdf')->stream('download.pdf');
You can change the orientation and paper size, and hide or show errors (by default, errors are shown when debug is on), (*7)
PDF::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->setWarnings(false)->save('myfile.pdf')
If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself., (*8)
In your templates, set the UTF-8 Metatag:, (*9)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Laravel Pdf package
MIT
laravel pdf dompdf