How to create a PDF file from a view using media = print for styles

Most questions in stackoverflow or other forums show how to create submissions and send them by email.

But my goal is to create a PDF file from a view in the format media=print and send it in the application by email.

I have a view that displays a report. I am using CSS Print to display this report in print format. (Basically I display some elements and hide others).

How can I generate a PDF from this view (with media=print format) and send it by email in the application.

I use ActionMailer to send emails and iTextSharp to create PDF files

+4
source share
1 answer

I also had the same problem and I have a lot of googling. but could not find the right solution. There was a third-party DLL called "PDFGenerator", but the result was not neat and nice. Therefore, I chose a different solution. I created a report file (.rdlc) with a user interface that I want to print as pdf code. Here is my github code example

0
source

Source: https://habr.com/ru/post/1441340/


All Articles