I have always struggled to find a simple and easy solution to generate PDF documents in ASP.net. pdf_image

There certainly are solutions out there but at a cost. There are also the open source developments of iTextSharp. However, the PDF generation is not simple and comes with a learning curve. I was in search of a solution that would take HTML I had already generated to a produce a PDF document.

I found a simple and easy solution, dompdf. However, it used the server technology php. Now there have always been debates between myself and my php developers as to which is the better server side technology, asp.net or php. When it comes to simple and inexpensive PDF generation I must give it to the php world, they have the better solution. dompdf is a style-driven renderer; thus it takes in the html and CSS stylesheets and passes the PDF rendering to another library called PDFlib. So what can I do since I want to program in asp.net? Combine the two? That is exactly what I did…

I had already generated the HTML code. Now all I wanted to do is generate an easy and simple PDF document. dompdf was the perfect solution. It was easy to use (no learning curves) and generates a PDF document from simple HTML.

This is what I did (download solution here):

Published in Development Blog

Call Us: +27 11 612 7460
LiveZilla Live Help