How to generate a PDF from a view using media=print for styles
- by Riderman de Sousa Barbosa
Most of the questions in stackoverflow or in other forums, show how to generate views and sends them by email.
But my goal is to generate a PDF from a view with the media=print format and sends it in attachment by email.
I have a view that displays a report.
I use CSS Print to display this report in a print format. (Basically I display some elements and hide others).
How can I generate a PDF from this view (with format media=print) and send it by e-mail in attachment.
I am using ActionMailer to send emails and iTextSharp to generate PDFs