I want to convert a web page into a pdf file. How to do it without using any third party component?
Loading
I want to convert a web page into a pdf file. How to do it without using any third party component?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
lovely neha44 reputationPosted Feb 25, 2009, 1:26 AM EST
hii...
try this code...
string
filename = "Customer";Response.Clear();
Response.AddHeader(
"content-disposition", "attachment;filename=" + filename + ".pdf");Response.Charset =
"";Response.Cache.SetCacheability(
HttpCacheability.NoCache);Response.ContentType =
"application/pdf";System.IO.
StringWriter stringWrite = new System.IO.StringWriter();System.Web.UI.
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);DataGrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Feb 25, 2009, 6:53 AM EST
1.http://www.html-to-pdf.net/Support.aspx#csharp
2.http://www.codeproject.com/KB/showcase/TallComponents.aspx
Mahesh ChandRank #1 · 393.3K reputationPosted Feb 25, 2009, 6:59 AM EST
Here are two more components to do so.
DynamicPDF and ExpertPDF
Duong2 reputationPosted Mar 30, 2009, 8:08 PM EDT
Does anyone know of a service where I can generate ASP pages to PDF files?
There are some but it cost about $1 a piece for it.
I am willing to get a second host and buy some software and link them together.