Open freenando opened 11 years ago
Are you sure the format of the request (_format attribute) is pdf format? It looks like it isn't.
I have the same issue. I am not getting a format in the request as I will always want to generate a pdf when calling this controller. Here is my code:
/**
Testing PDF', )); }
Please use
code notation
so I don't get notified :wink:
@Magnanimity : you should set default request format to "pdf" in your route definition.
..
@Route("/some", defaults={ "_format"="pdf" })
..
And how to set it outside of an controller?
Reason is I want to generate a invoice which isn't send to the browser, but instead sent as an email to the customer.
Hello, I need some help to generate a pdf with your bundle. I think installation was correctly and now I am trying to generate a pdf document like this:
//Controller in my bundle public function pdfAction($id_escuela, Request $request) { $format = $this->get('request')->get('_format'); return $this->render(sprintf('BackendAlumnosBundle:Default:pdfAlumnos.pdf.twig', $format)); }
//pdfAlumnos.pdf.twig
But it shows in the browser as html page with this source code <pdf> <dynamic-page> Hello FER </dynamic-page> </pdf> What I am doing wrong? Why could be the template isn´t rendered?
Thanks for your work!