2017 © Pedro Peláez
 

symfony-bundle html2pdf-bundle

Integrates the html2pdf REST service in Symfony 2

image

carlescliment/html2pdf-bundle

Integrates the html2pdf REST service in Symfony 2

  • Monday, September 28, 2015
  • by carlescliment
  • Repository
  • 1 Watchers
  • 1 Stars
  • 545 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Html2PdfServiceBundle

Build Status, (*1)

This is a Symfony 2 client for the Html2Pdf REST Service., (*2)

Installation

Include the bundle in your composer.json file., (*3)

    "require": {
        ...
        "carlescliment/html2pdf-bundle": "dev-master"
    }

Modify your AppKernel:, (*4)

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new carlescliment\Html2PdfServiceBundle\carlesclimentHtml2PdfServiceBundle(),
        );

Set the bundle configuration in your config.yml:, (*5)

parameters:
    html2pdf.host: http://html2pdf.mydomain.com
    html2pdf.port: 80

Execute php composer.phar update carlescliment/html2pdf-bundle, (*6)

Usage

From your controller, render the template and pass it to the service:, (*7)

class SampleController extends Controller
{
    public function toPdfAction()
    {
        $view = $this->renderView('YourBundle:Sample:toPdf.html.twig');
        $bridge = $this->get('html2pdf.bridge');
        $options = array('footer-left' => 'my footer');
        return $bridge->getFromHtml($view, 'document_name', $options);
    }
}

Testing

Execute phpunit in the bundle's root dir to run the tests., (*8)

If you need functional or integration tests and don't want to make real curl requests, you can use the NullProtocol in order to disable them. Put this configuration in your config_test.yml file., (*9)

html2pdf.protocol:
    class: carlescliment\Html2PdfServiceBundle\Protocol\NullProtocol

TO-DO

  • Port setting is currently being ignored

The Versions

28/09 2015

dev-master

9999999-dev

Integrates the html2pdf REST service in Symfony 2

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

html pdf conversion

28/09 2015

0.0.4

0.0.4.0

Integrates the html2pdf REST service in Symfony 2

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

html pdf conversion

28/10 2013

0.0.2

0.0.2.0

Integrates the html2pdf REST service in Symfony 2

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

html pdf conversion

23/10 2013

0.0.1-alpha

0.0.1.0-alpha

Integrates the html2pdf REST service in Symfony 2

  Sources   Download

GPL-2.0

The Requires

  • php >5.3.2
  • ext-curl *

 

The Development Requires

html pdf conversion