Click here to Skip to main content
Rate this: bad
good
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 at 21-Aug-12 4:52am
   
5'ed
Manas Bhardwaj at 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 at 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 at 21-Aug-12 4:52am
   
5'ed
ridoy at 21-Aug-12 6:21am
   
see it..
http://www.codeproject.com/Articles/260470/PDF-reporting-using-ASP-NET-MVC3
ridoy at 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 at 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
0 DamithSL 385
1 BillWoodruff 170
2 Zoltán Zörgő 165
3 OriginalGriff 164
4 Maciej Los 123
0 OriginalGriff 7,854
1 DamithSL 5,949
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,084
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 21 Aug 2012
Copyright © CodeProject, 1999-2014
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