html to PDF conversion Code in c#

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 12
Reputation: aerian is an unknown quantity at this point 
Solved Threads: 0
aerian aerian is offline Offline
Newbie Poster

html to PDF conversion Code in c#

 
0
  #1
May 22nd, 2007
i need a code in c# so that i can convert webpages n html pages into PDF format
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: html to PDF conversion Code in c#

 
0
  #2
May 22nd, 2007
this is a community help forum. We help you with your problem, we don't do everything for you. Tell us what you have tried and what problems your are having and we will help you solve them. We won't do everything for you.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 20
Reputation: kokkee is an unknown quantity at this point 
Solved Threads: 2
kokkee kokkee is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #3
May 23rd, 2007
out there got alot PDF convertion DLL, if u need for non bunisess use.
Or u can export your file to excel format using .net and then using microsoft 2007 to convert it to PDF.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 2
Reputation: Tunde is an unknown quantity at this point 
Solved Threads: 0
Tunde Tunde is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #4
May 24th, 2007
if you can wait till tomorrow i have code snippet that will perfectly work for you. See you tomorrow when i get to office
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 1
Reputation: flo2007 is an unknown quantity at this point 
Solved Threads: 0
flo2007 flo2007 is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #5
May 25th, 2007
Hi,

Here is a .NET 2.0 library for html to pdf conversion: www.html-to-pdf.net.

Here is some code sample from their website:

  1. PdfConverter pdfConverter = new PdfConverter();pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;pdfConverter.PdfDocumentOptions.ShowHeader = true;pdfConverter.PdfDocumentOptions.ShowFooter = true;pdfConverter.PdfDocumentOptions.LeftMargin = 5;pdfConverter.PdfDocumentOptions.RightMargin = 5;pdfConverter.PdfDocumentOptions.TopMargin = 5;pdfConverter.PdfDocumentOptions.BottomMargin = 5;pdfConverter.PdfDocumentOptions.UseMetafileFormat = true;pdfConverter.PdfDocumentOptions.ShowHeader = false;//pdfConverter.PdfHeaderOptions.HeaderText = "Sample header: " + TxtURL.Text;//pdfConverter.PdfHeaderOptions.HeaderTextColor = Color.Blue;//pdfConverter.PdfHeaderOptions.HeaderDescriptionText = string.Empty;//pdfConverter.PdfHeaderOptions.DrawHeaderLine = false;pdfConverter.PdfFooterOptions.FooterText = "Sample footer: " + TxtURL.Text + ". You can change color, font and other options";pdfConverter.PdfFooterOptions.FooterTextColor = Color.Blue;pdfConverter.PdfFooterOptions.DrawFooterLine = false;pdfConverter.PdfFooterOptions.PageNumberText = "Page";pdfConverter.PdfFooterOptions.ShowPageNumber = true;pdfConverter.LicenseFilePath = System.IO.Path.Combine(Server.MapPath("~"), "Bin");byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(url);System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;response.Clear();response.AddHeader("Content-Type", "binary/octet-stream");response.AddHeader("Content-Disposition", "attachment; filename=" + downloadName + "; size=" + downloadBytes.Length.ToString());response.Flush();response.BinaryWrite(downloadBytes);response.Flush();response.End();

See the original code sample here:
http://www.html-to-pdf.net/Support.aspx#csharp
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: winnovative is an unknown quantity at this point 
Solved Threads: 0
winnovative winnovative is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #6
May 31st, 2007
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: winnovative is an unknown quantity at this point 
Solved Threads: 0
winnovative winnovative is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #7
Oct 20th, 2007
Hi,

The new version 3.2.3 of the Winnovative HTML to PDF converter for .NET is now faster and has a lot of new features like CSS page breaks, live http links in PDF, keep together feature for any HTML element, password protection, embedded fonts, etc.
Here you can see all the HTML to PDF converter features. If you liked the version 2.x you'll love 3.2.3.

Regards,
Florin
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 2
Reputation: hunter_kriss is an unknown quantity at this point 
Solved Threads: 0
hunter_kriss hunter_kriss is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #8
Dec 13th, 2007
hi all ...
is there any free dll for html to pdf conversion, to be used in asp.net 2.0 ?
which doesn't show any "Evaluation Version" message in the converted file ...
please help ..
thanks ..
Last edited by hunter_kriss; Dec 13th, 2007 at 1:49 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 2
Reputation: hunter_kriss is an unknown quantity at this point 
Solved Threads: 0
hunter_kriss hunter_kriss is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #9
Dec 13th, 2007
hi ...

i tried this library, but this is giving some errors ...
pdfConverter.LicenseFilePath = System.IO.Path.Combine(Server.MapPath("~"), "Bin");
i suppose i am not having that licence ...

then what i did is, commented this piece of code ...
finally the file is generated as i wanted but with a message written in file as "Evaluation Version ..."

is there any other other method so that i can bypass the message of "Evaluation Version" in the generated pdf.

please help ...
thanks ...





Originally Posted by flo2007 View Post
Hi,

Here is a .NET 2.0 library for html to pdf conversion: www.html-to-pdf.net.

Here is some code sample from their website:

  1. PdfConverter pdfConverter = new PdfConverter();pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;pdfConverter.PdfDocumentOptions.ShowHeader = true;pdfConverter.PdfDocumentOptions.ShowFooter = true;pdfConverter.PdfDocumentOptions.LeftMargin = 5;pdfConverter.PdfDocumentOptions.RightMargin = 5;pdfConverter.PdfDocumentOptions.TopMargin = 5;pdfConverter.PdfDocumentOptions.BottomMargin = 5;pdfConverter.PdfDocumentOptions.UseMetafileFormat = true;pdfConverter.PdfDocumentOptions.ShowHeader = false;//pdfConverter.PdfHeaderOptions.HeaderText = "Sample header: " + TxtURL.Text;//pdfConverter.PdfHeaderOptions.HeaderTextColor = Color.Blue;//pdfConverter.PdfHeaderOptions.HeaderDescriptionText = string.Empty;//pdfConverter.PdfHeaderOptions.DrawHeaderLine = false;pdfConverter.PdfFooterOptions.FooterText = "Sample footer: " + TxtURL.Text + ". You can change color, font and other options";pdfConverter.PdfFooterOptions.FooterTextColor = Color.Blue;pdfConverter.PdfFooterOptions.DrawFooterLine = false;pdfConverter.PdfFooterOptions.PageNumberText = "Page";pdfConverter.PdfFooterOptions.ShowPageNumber = true;pdfConverter.LicenseFilePath = System.IO.Path.Combine(Server.MapPath("~"), "Bin");byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(url);System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;response.Clear();response.AddHeader("Content-Type", "binary/octet-stream");response.AddHeader("Content-Disposition", "attachment; filename=" + downloadName + "; size=" + downloadBytes.Length.ToString());response.Flush();response.BinaryWrite(downloadBytes);response.Flush();response.End();

See the original code sample here:
http://www.html-to-pdf.net/Support.aspx#csharp
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: winnovative is an unknown quantity at this point 
Solved Threads: 0
winnovative winnovative is offline Offline
Newbie Poster

Re: html to PDF conversion Code in c#

 
0
  #10
Dec 28th, 2007
With the Winnovative PDF Creator for .NET you can perform the HTML to PDF conversion with only a few lines of code.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC