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

.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.
Prasad_Kulkarni 21-Aug-12 4:52am
Manas Bhardwaj 21-Aug-12 5:13am
Thx :)
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 solutions.
Prasad_Kulkarni 21-Aug-12 4:52am
ridoy 21-Aug-12 6:21am
see it..
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,[^]

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

Hope this helps
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