rezozero / pdfsafe
Twig extension to clean-up an HTML content for PDF generation (psliwa/php-pdf)
1.1.2
2020-12-23 11:44 UTC
Requires
- twig/twig: 1.* || 2.* || 3.*
README
Clean a HTML/XML input to be generated in PDF by psliwa/php-pdf library.
Install
composer require rezozero/pdfsafe
Add this extension in your Twig environment.
use RZ\PdfSafe\PdfSafeExtension; use Symfony\Component\HttpFoundation\Request; $container->extend('twig.extensions', function ($extensions, $c) { /** @var Request $request */ $request = $c['request']; $extensions->add(new PdfSafeExtension($request->getSchemeAndHttpHost())); return $extensions; });