2017 © Pedro Peláez
 

library l5mpdf

mPDF wrapper for Laravel 5

image

donnykurnia/l5mpdf

mPDF wrapper for Laravel 5

  • Monday, April 4, 2016
  • by donnykurnia
  • Repository
  • 2 Watchers
  • 0 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

mPDF Wrapper for Laravel 5

In development., (*1)

License

License Latest Stable Version, (*2)

Instalation

Add:, (*3)

"donnykurnia/l5mpdf": "dev-master@dev",

To your composer.json, (*4)

or Run:, (*5)

composer require donnykurnia/l5mpdf

Then add:, (*6)

'Servit\Mpdf\ServiceProvider',

To the providers array on your config/app.php, (*7)

And, (*8)

'PDF'     => 'Servit\Mpdf\Facades\Pdf',

To the aliases array on yout config/app.php in order to enable the PDF facade, (*9)

Usage

$router->get('/pdf/view', function() {
    $pdf = \App::make('mpdf.wrapper', [
        'mode'   => 'id+aCJK',
        'format' => 'A4-L',
    ]);
    $pdf->WriteHTML('<h1>Page 1</h1>');
    $pdf->AddPage('P');
    $pdf->WriteHTML('<h1>Page 2</h1>');
    $pdf->stream();
});

Force download

$router->get('/pdf/download', function() {
    $html = view('pdfs.example')->render();

    return PDF::load($html)->download();
});

Output to a file

$router->get('/pdf/output', function() {
    $html = view('pdfs.example')->render();

    PDF::load($html)
        ->filename('/tmp/example1.pdf')
        ->output();

    return 'PDF saved';
});

This mPDF Wrapper for Laravel5 is open-sourced software licensed under the MIT license, (*10)

Default config

These default config can be overridden when creating the mpdf.wrapper., (*11)

[
    'mode'                  => '',
    'format'                => 'A4',
    'defaultFontSize'       => '',
    'defaultFont'           => '',
    'marginLeft'            => 10,
    'marginRight'           => 10,
    'marginTop'             => 10,
    'marginBottom'          => 10,
    'marginHeader'          => 10,
    'marginFooter'          => 5,
    'orientation'           => 'P',
]

The Versions

04/04 2016

dev-master

9999999-dev

mPDF wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar donnykurnia
by thongchai

laravel pdf mpdf

04/04 2016

v0.0.4

0.0.4.0

mPDF wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar donnykurnia
by thongchai

laravel pdf mpdf

04/04 2016

v0.0.3

0.0.3.0

mPDF wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar donnykurnia
by thongchai

laravel pdf mpdf

20/03 2016

v0.0.2

0.0.2.0

mPDF wrapper for Laravel 5

  Sources   Download

The Requires

 

by thongchai

laravel pdf mpdf

20/03 2016

v0.0.1

0.0.1.0

mPDF wrapper for Laravel 5

  Sources   Download

The Requires

 

by thongchai

laravel pdf mpdf

19/03 2015

dev-dev-master

dev-dev-master

mPDF wrapper for Laravel 5

  Sources   Download

The Requires

 

by thongchai

laravel pdf mpdf