Download the PHP package bushidoio/pdf-bundle without Composer
On this page you can find all versions of the php package bushidoio/pdf-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bushidoio/pdf-bundle
More information about bushidoio/pdf-bundle
Files in bushidoio/pdf-bundle
Package pdf-bundle
Short Description BushidoIOPDFBundle
License MIT
Homepage https://github.com/BushidoIO/PDFBundle
Informations about the package pdf-bundle
BushidoIOPDFBundle
The BushidoIOPDFBundle adds PDF file creation support in Symfony.
Features included:
- PDF creation from HTML string content
Symfony\Component\HttpFoundation\Response
object encapsulation withapplication/pdf
content type- Temporal data and fonts paths can be located inside or outside Symfony app folder tree
Installation
Step 1: Composer
Add the following require line to the composer.json
file:
And actually install it in your project using Composer:
You can also do this in one step with this command:
Step 2: Enable the bundle
Enable the bundle in the kernel:
Configuration
Temporal content folders can be configured in app/config/config.yml
. By
default both tmp and ttffontdatapath folder will be stored in app/cache
.
Be sure you have write permissions on both folders.
Usage examples
You can transform any HTML string to PDF with the bushidoio_pdf
service:
You can use Twig templates, or anything you like, to create the HTML string:
With the createResponse
method a Symfony\Component\HttpFoundation\Response
object is returned with application/pdf
content type that will be directly
downloaded if returned in a controller action: