项目作者: racklin

项目描述 :
PDF Generator for Laravel
高级语言: PHP
项目地址: git://github.com/racklin/pdf-generator.git
创建时间: 2017-06-12T16:04:49Z
项目社区:https://github.com/racklin/pdf-generator

开源协议:MIT License

下载


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

  1. {
  2. "require": {
  3. "racklin/pdf-generator": "dev-master"
  4. }
  5. }

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

  1. 'providers' => [
  2. //...
  3. Racklin\PdfGenerator\ServiceProvider::class,
  4. ]
  5. //...
  6. 'aliases' => [
  7. //...
  8. 'PDFGen' => Racklin\PdfGenerator\Facades\PdfGenerator::class
  9. ]

Example

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

Laravel Facade

  1. 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/