FrDeamon / EnseparHtml2pdfBundle

Html2pdf for Symfony 2 as a service.
MIT License
22 stars 22 forks source link

Allow to override general configuration #5

Closed matthieuauger closed 11 years ago

matthieuauger commented 11 years ago

Hi,

Once the parameters (mode, format, lang...) have been defined in the services.yml, you cannot change them dynamically.

And the object returned by the get() method (instance of HTML2PDF) has no setters for these parameters.

Thus you cannot have multiple PDF with different configuration.

This simple PR allow to set specific mode/format/lang... to PDF before getting it

OwlyCode commented 11 years ago

Hi! Thank you for this pull request, I never had that case in my needs but I believe it will help :-)

matthieuauger commented 11 years ago

Yes, a simple use-case is when you need some pdf in portrait mode, and others in landscape.

Thanks for your quick answer