Produce PDF from HTML with C# in ASP.Web

Produce PDF from HTML with C# in ASP.Web

PDF Duo .Web is a changing ingredient for use in ASP.Web (VB, C# and so on.) and permits to change HTML to PDF. The key class HtmlToPdf provides many procedures and homes to empower multi-function customization of the ensuing PDF. Major capabilities let to change HTML represented as a File, Web page from Url address, Stream or as a String.

Builders can effortlessly invoke the changing ingredient in their very own application or website projects on foundation of ASP.Web. To deploy the PDF Duo .Web ingredient you will will need only 3 strains of code. Setting up package is supplied with entirely featured demos prepared in the two C# and Visible Primary. Uncomplicated examples with supply code support you using the PDF Duo .Web ingredient to effectively change HTML to PDF.

I have made use of PDFDuo-Web.dll (variation 2.three) in my undertaking which is really helpful. Initially, you will need to change material of your ASPX to HTML and then transformed that HTML material into a PDF file or a further way which I use is to make a uncomplicated HTML string and then change it.

See below C# code:
using Procedure
using Procedure.Net
using Procedure.Net.UI
using Procedure.IO
using DuoDimension

community partial class _Default : Procedure.Net.UI.Web page

protected void Web page_Load(item sender, EventArgs e)

string html = “

” +

” +

” +

” +

” +

Solution Amount Charge
Solution Title one five $100
Solution Title 2 fifteen $300
Solution Title three 55 $five hundred


string pdf = “pdf_file.pdf”
DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf()
conv.PageInfo.PageFormat = ePageFormat.A4
conv.PdfDocumentInfo.Title = “Produce PDF from HTML supply”
conv.Header = “
HTML table Case in point
try out

conv.OpenHTML(html)
conv.SavePDF(MapPath(“~/Studies/”) + pdf)

catch (Exception ex)

throw ex

Adobe’s PDF format is 1 of the most extensively acknowledged document formats in use these days. Most consumers and shoppers count on that the software package you write will be equipped to crank out and work with PDFs. Regretably, having said that, Adobe does not present a absolutely free SDK that you can obtain and use you have to pay back to license the API.

Statically building PDF information is rather uncomplicated. Programs, these as OpenOffice.org Author, give the consumer alternatives to export a term processor document as a PDF file. End users can even find utilities that let them to “print” straight to a PDF file. Features like these are perfectly-identified to close consumers and are helpful for building a PDF based off a document at first developed in a further format.

But what about dynamic PDF generation? Some courses will need to be equipped to write out PDF information. PDF Duo .Web alleviates this issue. It will give you the capacity to incorporate PDF operation to your apps. Utilizing PDF Duo .Web, you can make PDF by changing HTML string or file, so you can produce the operation your consumers count on.

It is up to you how you crank out your HTML from your data supply and then change it to PDF or a further alternative is to change your ASPX to HTML initial and then to PDF. This will need to be accomplished since PDF Duo .Web ingredient can only functions with very clear html format. It did not assist for asp:handle and runat=server tag for now. You can utilize styleshhet to tables, h1, h2, paragraph, and all other people required stylesheet tag to comprehensive your PDF.

PDF Duo .Web is completely impartial, does not require any more components and actually acceptable for ASP.Web web sites. The ingredient is prepared fully in C# for the .Web system. PDF Duo .Web is a library that permits you to crank out (change) PDF paperwork from HTML world wide web page.

For extra info about the ingredient you should take a look at the product or service page:
http://www.duodimension.com/html_pdf_asp.internet/ingredient_html_pdf.aspx

If you have any inquiries or fears about ingredient, allow us know:
assist@duodimension.com

Comments are closed.