Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Using knp snappy bundle to generate pdf - symfony2 Ask Question. Asked 7 years, 9 months ago. Active 7 years, 5 months ago. Viewed 13k times. I did exactly that is told in the git link.
Improve this question. I assume you didn't download the binaries. Touki Installed the binaries. By failing to configure the path for windows.
I marked Christian's answer as accepted because it was the appropriate one for the problem scope i had. But your answer is also correct and we intend to use it in other areas of the project.
Thank you once again. I upvoted this answer too, because it's an alternative. Only ever use this approach with files that are outside of the public webspace, where you can't link them in with something else like an alias in apache or when you need a logic applied access restrictions, IP limits and such that you need to control inside your application.
ChristianRiesen, another use case of my approach would be to stop browser to process the files. For example you want to give user an option to download a image or pdf file. Browser will automatically show the image or open the pdf in browser if adobe plugin is installed. Adding Content-Disposition in header will ensure that browser will always prompt for download dialog. Of course any other header would also be relevant in this case, like caching and so on.
Saves a lot of headaches for larger files: php. Let's make a sample. Christian Riesen Christian Riesen 3 3 silver badges 12 12 bronze badges. In all the cases I used it, yes. Just adding the path of the file to the href attribute didn't work for me. When clicked, it just displays the file without really downloading it. You can also assign a value to the download attribute.
Warning: This post is about an unsupported Symfony version. Some of this information may be out of date. Read the most recent Symfony Docs. Help the Symfony project! Exams are online and available in all countries. Register Now. Massimiliano Arione said on Jun 29, at 1 Sweet!
Thierry Goettelmann said on Jun 29, at 2 Thank you Dennis for this nice little helper :. To complete vincent response, just add this right before returning response Alessandro Giuliani Alessandro Giuliani 81 1 1 silver badge 4 4 bronze badges.
Work for me. It would be better if you explained which lines you applied and why did you apply it. Yes, please explain what you have changed in the code and why, e. Liscare Liscare 1 1 silver badge 13 13 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown.
0コメント