I am creating an HTML table using WebSupergoo ABCpdf9 :

string htmlSample = "<table border='1'><tr> <td>Current Address</td> <td>Optio distinctio Sed vel quasi <br /> 281<br /> Mollitia ea qui adipisci voluptas, IL, 66293<br /> </td> </tr> <tr> <td>email</td> <td>demo@me.com</td> </tr> <tr> <td>dob</td> <td>8/18/2006 12:00:00 AM</td> </tr> </table>";

then

Doc doc = new Doc();
doc.AddHtml(htmlSample);
doc.HtmlOptions.Engine = EngineType.Gecko;  //<-- also tried this as well

Generated PDF The PDF has no table rows/columns or boarder when generated.

Any help ?

有帮助吗?

解决方案

AddHtml is for multi-styled text.

AddImageHtml is for true HTML/CSS web pages.

AddHtml is used for multistyled text. It's very fast. However it doesn't support HTML - it supports an HTML-like syntax - it supports HTML styled text. The key tags it doesn't currently support are img and table. It doesn't support CSS. It is designed principally for multi-styled text using an HTML-like syntax.

AddImageHtml is used for full HTML/CSS rendering. It's rather more sophisticated and complex but not as fast. It supports all tags including img and table. It supports CSS. It supports JavaScript. It supports everything you get in real-world web pages. You can use either the MSHTML engine for IE-like behavior and display or you can use our Gecko engine for Firefox-like behavior and display.

其他提示

After some searching and contacting tech support at websupergoo.com, here is the solution.

Do not use for styled html (anything)

doc.AddHtml(htmlSample);  <-- does not render html correctly

Use

doc.AddImageHtml(htmlSample);  <-- works.

I guess the method name threw me off.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top