Click here to Skip to main content
14,773,274 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anybody please share a good example of how to save html content as Word or Pdf file using ASP.NET MVC? I am showing a result summary to user on my View page. I want to give a feature to save this summary in Word / Pdf format on click of "save" button.

I read about setting the content-disposition, and other third party dll's (like evopdf, etc) to achieve this. But not quiet getting how to use it in reality. Some sample code will surely help me.

Thanks in advance
Posted

.Net does not have a inbuilt PDF support. You need to use a third party component for this. Check out Google[^], there are lot of free/paid components available.

I have used Aspose Words [^](it supports conversion to PDF as well), works quite well.
   
Comments
Prasad_Kulkarni 21-Aug-12 4:52am
   
5'ed
Manas Bhardwaj 21-Aug-12 5:13am
   
Thx :)
   
Comments
A M SOMAN 21-Aug-12 4:36am
   
@ridoy: I am looking for MVC solution here as there is major difference in return type. The links you gave are talking about plain asp.net solutions.
Prasad_Kulkarni 21-Aug-12 4:52am
   
5'ed
ridoy 21-Aug-12 6:21am
   
see it..
http://www.codeproject.com/Articles/260470/PDF-reporting-using-ASP-NET-MVC3
ridoy 21-Aug-12 6:22am
   
thanks Prasad
As already answered, .Net has no inbuilt support.
You need 3rd party components to cater your needs.

Check the url,
http://csharp-source.net/open-source/pdf-libraries[^]

You can also check evopdf(which is not free though, but will cater all your requirements for sure)

Hope this helps
cheers
   
Comments
Prasad_Kulkarni 21-Aug-12 4:53am
   
Good answer +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900