I have created an examanition module which provides the report card to the user as an HTML (twig) format. Now I want the user should be able to save the report card as pdf. I have added a button as Save ReportCard and I want to write the code in my controller to generate this pdf file with same content as of the html. I googled and found these links:
These links where great but I couldnt get how can i use them in symfony2. I am new to symfony2 and Php. Can anyonw help me here with the same.
Another solution, which is more painless than create a whole custom PDF, would be to create a print css. then get the whole DOM with a lib like wkhtml2pdf. There is also a Lib from knplabs https://github.com/KnpLabs/snappy and the bundle https://github.com/KnpLabs/KnpSnappyBundle
i often use this for tricky html5 projects. with the javascript support from wkhtml2pdf you can add svg's and other pretty things to your pdf...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With