View Razor for PDF

4

I need to convert Views from my MVC 5 application into C # using Razor to PDF. I've already tried it, and the free tools depend on iTextSharp, which I researched has a different markup.

But I need to convert any HTML page to PDF, that is, convert my existing pages with the least cost of time and future maintenance.

Some suggestions, free or paid that you use. Is there any solution that puts header and footer in any HTML?

    
asked by anonymous 18.08.2014 / 21:55

2 answers

2

Two options:

  • RazorPDF2 (package of my own, supports all the documents of the old RazorPDF + iTextSharp 5 package): link
  • Rotating (does not work on Azure): link
    • Receives as input View in HTML;
    • Examples: link
18.08.2014 / 22:22
0

What's wrong with the iTextSharp notation? Following the notation as is here worked for me, following the process:

1 - saving the content of the page that I want to convert to pdf
2 - escaping the tags (to be able to send to the controler) and sending to the controler
3 - [controller] sending to the method that converts (which is the same as the answer)
4 - Reversing the string (applying the tags again)
5 effectively following what was in the post (the difference is that the 'html' is my string containing everything I want to save in pdf)

    
21.08.2014 / 00:14