title: Html Render to Image (C#/Net) WITHOUT using WebBrowser
body: <p>I have html string/document (if you view source any web page in the IE browser, the resulting html code) stored in the database and I need to convert this html to an image using C#/.Net wcf service. The current code is using WebBrowser and it works fine except it is pretty slow and runs into issues once in a while.</p>
  
  <p>I want to replace this capability (html conversion to .png image) without using WebBrowser. I tried to use TheArtofdev.HtmlRenderer which appears to solve most issues but it seems to run into problems when it encounters html (containing multiple "div>" may be ?) like the following html and it doesn't generate the image correctly.It generates only a partial image for this html.</p>
  
  <pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head&gt;&lt;style&gt;p { padding: 0px; border: 0px ; margin: 0px;}ul { padding: 0px; border: 0px; margin: 0px;}&lt;/style&gt;&lt;title&gt;Item 18626&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;table border="0" width="700"&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;&lt;font face="verdana,geneva"&gt;Item 18626&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;&lt;/br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;font face="verdana,geneva"&gt;&lt;p style="font-weight:normal; font-weight:normal; "&gt;Use the following passages to answer the question. &lt;/p&gt;&lt;p style="font-weight:normal; "&gt;&amp;#xA0;&lt;/p&gt;&lt;div align="center"&gt;&lt;p&gt;&lt;b&gt;Mariana's Thesis Statement&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;table&gt;&lt;colgroup style="width:46.6206em; " /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding:0.2292em;  border:0.0834em solid #000000; "&gt;&lt;p style=""&gt;The Cold War policy of containment was a success.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&amp;#xA0;&lt;/p&gt;&lt;div align="center"&gt;&lt;p&gt;&lt;b&gt;Information on the Vietnam War&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;table&gt;&lt;colgroup style="width:46.6206em; " /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding:0.2292em;  border:0.0834em solid #000000; "&gt;&lt;p style=""&gt;The United States sent advisors to South Vietnam in 1954 to help the government fight communist guerrillas who wanted to reunite with communist North Vietnam. By 1964, the United States began sending combat troops. The U.S. military used extensive bombing and advanced technology; however, they were unable to turn the tide against communism. In 1973, the United States withdrew from South Vietnam, and in 1975, the government of South Vietnam fell to the communists and the country was reunited.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&amp;#xA0;&lt;/p&gt;&lt;p&gt;Mariana is writing a paper about the Cold War and discovers the information above on the Vietnam War. &lt;/p&gt;&lt;p style="font-weight:normal; "&gt;&amp;#xA0;&lt;/p&gt;&lt;p style="font-weight:normal; "&gt;Describe one way the passage above refutes Mariana's thesis.&lt;/p&gt;&lt;p style="font-weight:normal; "&gt;&amp;#xA0;&lt;/p&gt;&lt;p style="font-weight:normal; "&gt;Type your answer in the space provided.&lt;/p&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;div id="001" style="border:solid black 1px;width:700px;overflow-x:hidden;overflow-y:visible;text-align:left;word-wrap:break-word"&gt;&lt;p&gt;it refutes because it dosent talk about the cold war it only talks about the vietnam war and it just says that the codntainment war was a success thats all it says about the containment war it &amp;nbsp;really just talks about the vietnam war&lt;/p&gt;
      &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;/br&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Can I tweak the above html to make the HtmlRender happy somehow ?
  What are the other options (.Net/C#) if HtmlRender doesn't work as expected ? Highly appreciate any help !!</p>