Download the PHP package pmarien/html-to-pdf-bundle without Composer
On this page you can find all versions of the php package pmarien/html-to-pdf-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pmarien/html-to-pdf-bundle
More information about pmarien/html-to-pdf-bundle
Files in pmarien/html-to-pdf-bundle
Package html-to-pdf-bundle
Short Description Symfony integration for pmarien/html-to-pdf
License MIT
Informations about the package html-to-pdf-bundle
pmarien/html-to-pdf-bundle
Symfony integration for pmarien/html-to-pdf
- Requirements
- How to install?
- How to configure?
- How to use internal assets?
- How to use?
- Controller (Inline PDF)
- Controller (Download PDF)
- Controller (Store PDF file)
- With Twig Templates
- Controller (Inline PDF)
- Controller (Download PDF)
- Controller (Store PDF file)
Requirements
The bundle requires PHP in version 8.1 or higher and Symfony in version 5, 6 or 7.
The html-to-pdf-library requires implementations of psr/http-message
, psr/http-factory
and psr/http-client
.
How to install?
The bundle should be installed via composer: pmarien/html-to-pdf
.
How to configure?
If you want to configure the bundle you should add the file config/packages/html_to_pdf.yaml
.
Without api key configuration the bundle will act as anonymous client, which leads to a limit of 3 generated PDF files per day.
How to use internal assets?
If you want to use assets in your pdf, they have to be public accessible via http for the pdf generator. Sometimes you want to use the assets, but don't want to publish them. For those cases, this bundle comes with an AssetAccessController, which requires a hash for file protection.
The routing have to be enabled via config (config/routes/html_to_pdf.yaml
):
Asset uris can be build manually (route name: html_to_pdf_get_file
, required parameters: filename
and hash
) or via
twig filter:
If you build uris manually, the hash can be generated via PMA\HtmlToPdfBundle\Asset\AssetAccessorInterface::getHash
(available as symfony service).
How to use?
If you want to generate pdf files directly from html, you should use PMA\HtmlToPdfBundle\Bridge\FoundationBridge
as
generator. It's available as service in the service container and may be autowired by symfony's dependency injection.
Controller (Inline PDF)
Controller (Download PDF)
Service (Store PDF file)
Twig
If you want to generate pdf files from twig templates, you should use PMA\HtmlToPdfBundle\Bridge\TwigBridge
as
generator. It's available as service in the service container and may be autowired by symfony's dependency injection.
It requires Twig to be installed in your project.
Controller (Inline PDF file)
Controller (Download PDF file)
Service (Store PDF file)
All versions of html-to-pdf-bundle with dependencies
symfony/framework-bundle Version ^5.0|^6.0|^7.0
symfony/psr-http-message-bridge Version ^2.0|^6.0|^7.0
pmarien/html-to-pdf Version ^1.0