Skip to content

Twig extension to clean-up an HTML content for PDF generation (psliwa/php-pdf)

License

Notifications You must be signed in to change notification settings

rezozero/pdfsafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PdfSafe Twig extension

Packagist

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;
});

About

Twig extension to clean-up an HTML content for PDF generation (psliwa/php-pdf)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages