-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not render pdf template #33
Comments
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: /**
|
Please use
so I don't get notified 😉 |
@Magnanimity : you should set default request format to "pdf" in your route definition.
|
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!
The text was updated successfully, but these errors were encountered: