| | |
html to PDF conversion Code in c#
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2007
Posts: 20
Reputation:
Solved Threads: 2
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.
Or u can export your file to excel format using .net and then using microsoft 2007 to convert it to PDF.
•
•
Join Date: May 2007
Posts: 1
Reputation:
Solved Threads: 0
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:
See the original code sample here:
http://www.html-to-pdf.net/Support.aspx#csharp
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:
ASP.NET Syntax (Toggle Plain Text)
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
•
•
Join Date: May 2007
Posts: 4
Reputation:
Solved Threads: 0
You can also try http://www.dotnet-reporting.com and http://www.winnovative-software.com :-)
•
•
Join Date: May 2007
Posts: 4
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Dec 2007
Posts: 2
Reputation:
Solved Threads: 0
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 ...
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 ...
•
•
•
•
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:
ASP.NET Syntax (Toggle Plain Text)
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
•
•
Join Date: May 2007
Posts: 4
Reputation:
Solved Threads: 0
With the Winnovative PDF Creator for .NET you can perform the HTML to PDF conversion with only a few lines of code.
![]() |
Similar Threads
- Using VB Code - Silent download pdf from server and print to local printer (Visual Basic 4 / 5 / 6)
- html to pdf conversion (PHP)
- Using HTML tags in PHP code (PHP)
- Help-Email gone wild...trojan.download (Viruses, Spyware and other Nasties)
Other Threads in the ASP.NET Forum
- Previous Thread: GridView with Query String Array
- Next Thread: ASP.NET
Views: 17916 | Replies: 10
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac chat checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi identity iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order problem profile ratings redirect refer registration relationaldatabases response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xsl





