Create PDF from HTML page with formatting retained in PDF in ASP.Net
- by Vishal Avhad
I am trying to convert an HTML page to a PDF using iTextSharp.dll in ASP.Net.
I am able to convert the contents to my PDF , but the problem is that the Formatting of HTML page (which is inline) get removed from my PDF created.
For instance I have the following code block to be formatted from my HTML page to PDF.
<table style="width:90%; float:left; background:#dddddd; padding:15px; border:1px solid #000; color:#000;"><tr><td style="text-transform:uppercase; font-size:14px;font-weight:bold;">SPECIAL DELIVERY FOR:</td></tr><tr><td style="padding-left:40px; font-size:12px; color:#4e4e4e;">Name: #CustomerName#
<br /><br /><label>
<b>Date: #CreatedOn#
</b></label><br />
</td></tr>
</table>
I have to format my PDF with much more HTML codes like this.
I have used the Stylesheet class also, but that was not much of help.