2017 © Pedro Peláez
 

library laravel-pdf

Laravel Pdf package

image

haska/laravel-pdf

Laravel Pdf package

  • Monday, September 29, 2014
  • by haska
  • Repository
  • 1 Watchers
  • 3 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel pdf package

Informations

Provider:, (*1)

'Haska\Pdf\PdfServiceProvider',

Alias:, (*2)

'PDF' => 'Haska\Pdf\Facade',

Config:, (*3)

php artisan config:publish haska/laravel-pdf

DOMPDF Wrapper for Laravel 4

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)

Tip: UTF-8 support

In your templates, set the UTF-8 Metatag:, (*9)

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

The Versions

29/09 2014

dev-master

9999999-dev

Laravel Pdf package

  Sources   Download

MIT

The Requires

 

by David Haska

laravel pdf dompdf