Quantcast
Channel: HTML Renderer
Viewing all articles
Browse latest Browse all 693

New Post: issue

$
0
0
I'm going to assume you are interested in something like this:
CssData css = HtmlRenderer.CssData.Parse("body{font-family:italic;background-color:Yellow;san-serif;font-size:100px;}", true);

Image m_Bitmap = HtmlRender.RenderToImage("<html><body><div><div>Hello World, Converting Html To Image!!!</div></div></body></html>", Size.Empty, new System.Drawing.Size(500, 500), Color.White, css);

m_Bitmap.Save(@"D:\Test.png", ImageFormat.Png);
Please invest the time in your code:
  1. You used totally unrelated discussion to ask your question
  2. Your CSS is invalid, really not related to HTML Renderer project.
  3. In related previous discussion I pointed to relevant page: Generate image from HTML markup. If its unclear please let me know how to improve it.
  4. the sample code you provided contains unused code:
var img = HtmlRender.RenderToImage(File.ReadAllText(@"D:\html.txt"), 600);
Good luck,
Arthur.

Viewing all articles
Browse latest Browse all 693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>