1

i have a string variable with html code and need convert to pdf the code of the variable, the variable is filled with the data of one gridview

<div>
<table>
<tr>
<td>Name</td>
<td>Cuty</td>
<td>Other Row</td>
<tr>
<td>Jonh</td>
<td></td>
<td></td>
<tr>
<tr>
<td>Name</td>
<td style="background-color:#00AA55;">Mary</td>
<td></td>
<td></td>
<tr>
</table>
</div>

and i need convert this table in pdf including the row style. currently use itext library but don't add the style on the document

miguelSnam
  • 73
  • 2
  • 9
  • See this similar question: http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net – Oscar Jun 24 '13 at 18:52

2 Answers2

0

If you want a lot of painstaking work - create your own html -> pdf converter using PDFSharp (http://pdfsharp.com/). However, depending on the usage, I've heard using the internet explorer COM is a good solution. You can always print an HTML page to a virtual PDF printer.

RutledgePaulV
  • 2,568
  • 3
  • 24
  • 47
0

Use PDFizer, whenever you have valid xHTML (which you should always have).

It's pretty much the most reliable library out there.

Jan Berktold
  • 976
  • 1
  • 11
  • 33