Click here to Skip to main content
12,624,895 members (37,274 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET MVC4
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 20-Aug-12 22:52pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

.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.
  Permalink  
Comments
Prasad_Kulkarni 21-Aug-12 4:52am
   
5'ed
Manas Bhardwaj 21-Aug-12 5:13am
   
Thx :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 21 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100