2

Is there a way to convert HTML inside a div to an image in C# with all its formatting preserved.

Also is there a way to show text inside a div in Print Preview mode.

rahul
  • 184,426
  • 49
  • 232
  • 263

1 Answers1

2

This doesn't seem to be so easy. The mostly used method is to let a browser do then rendering and then somehow make it export a "capture" of this page.

See this question on SO for some more possible answers.

You could also do a search on web-scraping, which might be helpful.

Community
  • 1
  • 1
Robert Massa
  • 4,345
  • 1
  • 32
  • 44
  • Is there a way to find that the web page has been loaded completely. – rahul Jun 22 '09 at 07:57
  • You need to give a bit more information than that, where would you like to find out if it's loaded? On the client(javascript), using a component(and which)? – Robert Massa Jun 22 '09 at 08:17
  • Actually when I try to convert the document to an image right now I am getting a white image with no contents inside it. I think its because the page hasn't been loaded yet. – rahul Jun 22 '09 at 09:04