3

I am creating a page with TinyMCE editor and I need to convert content of editor into a PDF. I am loading the editor with default content which contins <p> and <div> tags and one <table>.

I have tried to apply border to <td> and it is working but if I apply background-color to some <td> then in editors it seems perfect but in generated PDF I am not able to see bottom border of <td> which is above that <td> with background color.

strDetailtable.Append("<tr style='border:0;border-bottom-color:Black;border-bottom-width: 1px;border-bottom-style: solid;'>");
strDetailtable.Append("<td style='border:0;border-bottom-color:Black;border-bottom-width: 1px;border-bottom-style: solid;border-right-width: 1px;border-right-style: solid;width:200px;padding-bottom:5px;'>" + item.data1+ " </td>");
strDetailtable.Append("<td style='border:0;border-bottom-color:Black;border-bottom-width: 1px;border-bottom-style: solid;border-right-width: 1px;border-right-style: solid;width:200px;padding-bottom:5px;'>" + item.data2+ " </td>");
strDetailtable.Append("<td style='border:0;border-bottom-color:Black;border-bottom-width: 1px;border-bottom-style: solid;border-right-width: 1px;border-right-style: solid;width:200px;padding-bottom:5px;'>" + item.data3+ " </td>");
 strDetailtable.Append("</tr>");

strDetailtable.Append("<tr><td  colspan='3' style='background-color:#D9D9D9;font-weight:bold;border:0;border-bottom-width: 1px;border-bottom-style: solid;width:200px;padding-bottom:5px;padding-top:5px;'>" + item.headerdata + " </td></tr>");
Chris Haas
  • 53,986
  • 12
  • 141
  • 274
GMD
  • 761
  • 5
  • 21

2 Answers2

0

If you are using XMLWorkerHelper to parse the Html you should not have problems, look at conformance list off css attribute supported, and tablecell border style attribute is supported; are you using HTMLWorker?

ale
  • 10,012
  • 5
  • 40
  • 49
  • border is working but when i add background color to td i am not able to see bottom border of td above that, i also tried to give color to border of td. – GMD Mar 14 '14 at 09:30
-1

try bgcolor='#004785' instead of background-color:#D9D9D9; e.g. <td bgcolor='#004785' style= ''>testing...</td>