View Razor to PDF

Asked

Viewed 1,514 times

4

I need to convert Views of my MVC 5 application to C# using Razor to PDF. I already searched, and the free tools depend on iTextSharp, which I searched for has a different marking.

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

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

2 answers

2

Two options:

  • With Razorpdf I can take any view and turn it into PDF, or you have to use iTextSharp Tags?

  • @You have to assemble a Razor using the iTextSharp tags. If you want to transform a View PDF, better use Rotary.

0

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

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

  • the problem with itextsharp is that it is paid and the value is abusive =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.