racklin / pdf-generator by racklin

simple pdf generator for laravel 5
111
3
3
Package Data
Maintainer Username: racklin
Maintainer Contact: racklin@gmail.com (Rack Lin)
Package Create Date: 2017-06-12
Package Last Update: 2017-09-01
Language: PHP
License: MIT
Last Refreshed: 2024-12-23 03:16:08
Package Statistics
Total Downloads: 111
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 3
Total Forks: 5
Total Open Issues: 0

Simple PDF Generator for Laravel

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/