racklin/pdf-generator

simple pdf generator for laravel 5

dev-master 2017-09-01 08:46 UTC

This package is auto-updated.

Last update: 2024-12-04 12:17:25 UTC


README

Simple PDF Generator for Laravel using tcpdf library.

This package using json as template and you can pass php array as data to generate PDF.

It is useful to generate PDF for printing to preprint paper, ex Invoice.

Installation

{
    "require": {
        "racklin/pdf-generator": "dev-master"
    }
}

Next, add the service provider to config/app.php.

'providers' => [
    //...
    Racklin\PdfGenerator\ServiceProvider::class,
]

//...

'aliases' => [
	//...
	'PDFGen' => Racklin\PdfGenerator\Facades\PdfGenerator::class
]

Example

$pdf = new PdfGenerator();

$pdf->generate('example_01.json', ["name"=>"rack", "cname"=>"阿土伯"], '/tmp/example.pdf', 'F');

Laravel Facade

PDFGen::generate('example_01.json', ["name"=>"rack", "cname"=>"阿土伯"], '/tmp/example.pdf', 'F');

Laravel version

Current package version works for Laravel 5+.

License

MIT: https://racklin.mit-license.org/