Click here to Skip to main content
14,920,001 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How can i convert an .aspx page to a PDF file in button click using ASP.NET? Can anybody who knows please help me?
Posted
Updated 21-Jan-11 17:07pm
v2
Comments
Indivara 21-Jan-11 23:07pm
   
Added tags, minor fixes

   
Comments
Madhulika Satalkar 4-Feb-13 4:46am
   
my page is web form including master page and having ..............multiple CSS so itestsharp is not useful for external CSS.................plz suggets
thnx
I have gone thorugh this recently, I suggest you to go with iTextSharp.
I have tried many ways and finally concluded it as a best available solution.
They provide very good support for Conversion.
And with help of 'htmltopdf'(search this term), You will be able to convert part of HTML to PDF.
Go for the newer version of iTextSharp(version 5).
If you need more assistance then please be specific on it, I will help you for sure.
   
If you are doing any report , you can use Microsoft RDLC Report and on certain event you can export it to PDF , Excel Etc.
   
Just use THIS[^] article as a reference.

.aspx page is ultimately get converted in HTML so think about HTMLtoPDF.

I think that article will take you towards your goal.
   
Hi,

There are many third party tools are available to do that.
Like itextsharp,PdfSharp etc. Search on them. You will get a more help.


umesh
   
Comments
Rupa1 20-Jan-11 5:30am
   
without third party we can't do......?
soni uma 20-Jan-11 5:35am
   
No, In .net there is not any inbuilt feature that provide to generate pdf. You must have to use third party for proper solution.
Rupa1 20-Jan-11 5:52am
   
thx a lot sir...............
soni uma 20-Jan-11 5:54am
   
u welcome. But don't forgot to rate answer. it help to you and me in point increase.
Rupa1 20-Jan-11 6:06am
   
what is the use of rate to answer
soni uma 20-Jan-11 6:13am
   
Read content on this page
http://www.codeproject.com/script/Membership/Reputation.aspx
Rupa1 20-Jan-11 6:21am
   
ok now i understood thx..........
I have gone thorugh this recently, I suggest you to go with iTextSharp.
I have tried many ways and finally concluded it as a best available solution.
They provide very good support for Conversion.
And with help of 'htmltopdf'(search this term), You will be able to convert part of HTML to PDF.
Go for the newer version of iTextSharp(version 5).
If you need more assistance then please be specific on it, I will help you for sure.
   
Comments
Rupa1 21-Jan-11 8:53am
   
thx a lot sir.....for u reply
Gandalf_TheWhite 22-Jan-11 9:51am
   
You're welcome...
So have you started?
Rupa1 23-Jan-11 22:53pm
   
ok ...sir
Gandalf_TheWhite 27-Jan-11 3:30am
   
So, If you stuck anywhere, let me know I will help you.
Recently just two day before, I have generated PDF from HTML(Table based). And its generating awesome output with styles.
Member 7922075 26-Oct-12 1:41am
   
hi, i have same issue
can u help me?
Madhulika Satalkar 4-Feb-13 4:45am
   
my page is having multiple external CSS ............using itextxharp......is not useful for me bcoz its not working with CSS............plz suggest something which will work with CSS
thnx
KimberleeL 1-Jun-15 5:15am
   
Hi Madhulika, you can use some library that can convert those external CSS into an inline CSS before you use iTextSharp on that HTML content.
For example check the following StackOverflow post:
.NET convert external CSS to inline CSS[^]
But unfortunately iTextSharp has some difficulties with processing HTML content, so instead I used this approach:
Convert HTML to PDF in C# and VB.NET[^]

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