I’m using Snappy Bundle along with Symfony 2.1.
I have some question I did not find in the documentation of this bundle :
- How to set the orientation ?
- Is there a way to display page numbers ?
Here is my config.yml for the bundle :
knp_snappy:
pdf:
enabled: true
binary: /home/wkhtmltopdf-i386
options: []
Here is one of my Controller to generate a pdf :
public function exampleAction() {
$html = $this->renderView('MyBundle:Example:test.pdf.twig', $this->param);
return new Response($this->get('knp_snappy.pdf')->getOutputFromHtml($html),200, array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="Test.pdf"'));
}
Thanks a lot for your help!
1 Answer