473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Converting HTML file to PDF file

I have a sample.html file which i want to convert to sample.pdf file. How is it possible using C# Dotnet. Conversion of HTML to PDF.
Aug 31 '06 #1
3 3010
nmsreddi
366 256MB
hi frnd


this is code in asp.net hope may help you

private void lnkPdf_Click(object sender, System.EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.ContentType = "application/vnd.pdf";//for pdf
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
//this.grdReport2.RenderControl(htmlWrite);
*** data to be exported i.e from datagrid or any control source***** }
Response.Write(stringWrite.ToString());
Response.End();
}




if still problem not solved try to post again


regards

nmsreddi
Sep 1 '06 #2
Hi nmsreddi,

Thanks for your quick response but it doesn't work. Let me explain you clearly, I want to convert the HTML page to PDF using C#.
Sep 1 '06 #3
fatuma
1
[quote=munavvar]Hi nmsreddi,

I want to do something .Let me explain you clearly, I want to convert the HTML page to PDF using C#.For html page I used server side table and generate html report then I want to convert that to pdf file.
Apr 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Donald Firesmith | last post by:
We are converting the OPEN Process Framework Repository (www.donald-firesmith.com) of over 1,100 free open source reusable process components for building development methods for...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
2
by: mike | last post by:
regards: I follow the following steps to converting from HTML to XHTML http://webpageworkshop.co.uk/main/xhtml_converting My parser is http://htmlparser.sourceforge.net/ Xhtml version is 1.0...
2
by: Ben Amada | last post by:
Hello, A partner is going to be creating some HTML files that I plan on converting to user controls (UC) and dynamically load at runtime. I'm guessing Visual Studio doesn't come with some...
9
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.