Make PDF from HTML with C# in ASP.Web

Make PDF from HTML with C# in ASP.Web

PDF Duo .Web is a changing ingredient for use in ASP.Web (VB, C# and so forth.) and allows to convert HTML to PDF. The main course HtmlToPdf gives numerous procedures and qualities to allow multi-purpose customization of the ensuing PDF. Key capabilities allow for to convert HTML represented as a File, Page from Url tackle, Stream or as a String.

Developers can very easily invoke the changing ingredient in their very own software or website jobs on foundation of ASP.Web. To deploy the PDF Duo .Web ingredient you will want only three traces of code. Installing package deal is supplied with completely highlighted demos published in both of those C# and Visible Essential. Very simple illustrations with resource code support you applying the PDF Duo .Web ingredient to correctly convert HTML to PDF.

I have made use of PDFDuo-Web.dll (version 2.3) in my project which is extremely valuable. To start with, you want to convert content material of your ASPX to HTML and then transformed that HTML content material into a PDF file or yet another way which I use is to build a simple HTML string and then convert it.

See under C# code:
applying Program
applying Program.Net
applying Program.Net.UI
applying Program.IO
applying DuoDimension

community partial course _Default : Program.Net.UI.Page

safeguarded void Page_Load(item sender, EventArgs e)

string html = “

” +

” +

” +

” +

” +

Product Quantity Price tag
Product Name one 5 $100
Product Name 2 fifteen $300
Product Name 3 55 $500

string pdf = “pdf_file.pdf”
DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf()
conv.PageInfo.PageFormat = ePageFormat.A4
conv.PdfDocumentInfo.Title = “Make PDF from HTML resource”
conv.Header = “
HTML desk Example

conv.SavePDF(MapPath(“~/Stories/”) + pdf)

catch (Exception ex)

toss ex

Adobe’s PDF format is a person of the most greatly accepted document formats in use nowadays. Most users and customers be expecting that the computer software you produce will be capable to produce and operate with PDFs. Unfortunately, however, Adobe does not present a free of charge SDK that you can obtain and use you have to spend to license the API.

Statically creating PDF information is fairly simple. Applications, this sort of as Author, give the consumer solutions to export a word processor document as a PDF file. Users can even locate utilities that allow for them to “print” directly to a PDF file. Options like these are properly-regarded to finish users and are valuable for creating a PDF dependent off a document at first created in yet another format.

But what about dynamic PDF technology? Some systems want to be capable to produce out PDF information. PDF Duo .Web alleviates this trouble. It will give you the skill to insert PDF functionality to your apps. Using PDF Duo .Web, you can build PDF by changing HTML string or file, so you can provide the functionality your users be expecting.

It is up to you how you produce your HTML from your facts resource and then convert it to PDF or yet another possibility is to convert your ASPX to HTML initially and then to PDF. This want to be finished mainly because PDF Duo .Web ingredient can only will work with very clear html format. It did not aid for asp:handle and runat=server tag for now. You can utilize styleshhet to tables, h1, h2, paragraph, and all many others required stylesheet tag to finish your PDF.

PDF Duo .Web is absolutely impartial, won’t call for any additional elements and seriously acceptable for ASP.Web internet sites. The ingredient is published totally in C# for the .Web system. PDF Duo .Web is a library that makes it possible for you to produce (convert) PDF paperwork from HTML world wide web webpage.

For a lot more details about the ingredient be sure to pay a visit to the product or service webpage:

If you have any concerns or issues about ingredient, enable us know:

Comments are closed.