2017 © Pedro Peláez
 

library html2pdfbundle

This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications. I did this bundle because 'ensepar/html2pdf-bundle' does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same.

image

smachara/html2pdfbundle

This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications. I did this bundle because 'ensepar/html2pdf-bundle' does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same.

  • Thursday, March 24, 2016
  • by smachara
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,605 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

smacharaHtml2pdfBundle

This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications., (*1)

I did this bundle because "ensepar/html2pdf-bundle" does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same., (*2)

Installation

Step 1: Setup Bundle and dependencies

composer require smachara/html2pdfbundle

Step 2: Configure the autoloader

Add the smachara namespace to your autoloader:, (*3)

``` php // app/autoload.php <?php // ... $loader->add('smachara', DIR . '/../vendor');, (*4)


### Step 3: Enable the bundle in the kernel Add the bundle to the `registerBundles()` method in your kernel: ``` php // app/AppKernel.php <?php public function registerBundles() { $bundles = array( // ... new smachara\html2pdfbundle\smacharaHtml2pdfBundle(), ); }

How to use ?

In your action:, (*5)


public function printAction() { $pdf = $this->get('html2pdf_factory')->create(); $html = $this->renderView('PdfBundle:Pdf:content.html.twig', array( 'preview' => false)); $pdf->writeHTML($html); $response = new Response($pdf->Output('test.pdf','D')); return $response; }

You can pass every option you would pass to $pdf, for instance :, (*6)

$pdf = $this->get('html2pdf_factory')->create('P', 'A4', 'en', true, 'UTF-8', array(10, 15, 10, 15));

If the previous arguments are not provided, the factory uses its own default values. You can change this default values by adding the bundle configuration to your app/config/config.yml :, (*7)

smachara_html2pdf:
    orientation: P
    format: A4
    lang: en
    unicode: true
    encoding: UTF-8
    margin: [10,15,10,15]

License

The Versions

24/03 2016

dev-master

9999999-dev http://SynfonyAventure.org/

This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications. I did this bundle because 'ensepar/html2pdf-bundle' does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same.

  Sources   Download

LGPL

The Requires

 

html pdf html2pdf

24/03 2016

v1.0.1

1.0.1.0 http://SynfonyAventure.org/

=This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications. I did this bundle because 'ensepar/html2pdf-bundle' does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same.

  Sources   Download

LGPL

The Requires

 

html pdf html2pdf

24/03 2016

v1.0

1.0.0.0 http://SynfonyAventure.org/

=This is a Bundle to use the last version of spipu-Html2pdf as a service in Symfony2 applications. I did this bundle because 'ensepar/html2pdf-bundle' does not use the last versions of spipu-Html2pdf and TCPDF. The rest still the same.

  Sources   Download

LGPL

The Requires

 

html pdf html2pdf