apsg / certificate
Create PDF certificates
0.1.0
2021-04-30 11:12 UTC
Requires
- apsg/fpdi-fpdf: v2.3.1
- illuminate/support: ~5|~6
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-10-30 01:39:30 UTC
README
Helper package to provide easy PDF certificates generation. It uses FPDI/FPDF under the hood and is configured to provide support for Polish language. It works as a Laravel 5/6 package but there is not much of Laravel specific functionality added, so it can be used in other projects as well.
Installation
Via Composer
$ composer require apsg/certificate
Usage
use Apsg\Certificate\Certificate; use Apsg\Certificate\Fields\Field; use Apsg\Certificate\Formats\A4LandscapeFormat; class CertificateController extends Controller { /** * This will output the pdf to browser to download */ public function test() { $certificate = new Certificate(null, new A4LandscapeFormat()); return $certificate ->setBackground(storage_path('app/public/tlo.png')) ->addField(new Field('test zażółć gęślą', 10, 100, 20)) ->generate(); } }
Note: the background would be stretched to fill the page, so use proper resolution and orientation for best results.
Testing
$ composer test