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.
Via Composer
$ composer require apsg/certificateuse 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.
$ composer test