Search code examples
c#asp.netinternet-explorerbitmapscreenshot

ASP.NET screenshot page


Related Stack Overflow question is Programmatically get a screenshot of a page.

My users will be logged into a private system, and I want to have a button on the page that says "Take Screenshot". This will link into the support system, and when they take the screen shot, it creates a new ticket with the screen shot as an automatic attachment.

Content is variable, depending on who you are logged in as! This means I can't use an external screen shotting tool.

Ideally, I would like all the HTML to be rendered to a bitmap which is saved to a disk. Is there some sort of server-side Internet Explorer component that can render the HTML and save it as a BMP?

Kierren made good points. If I can grab the HTML via JavaScript, is there any server-side plugin that can render the HTML as an image as viewed through Internet Explorer?


Solution

  • I did some unsuccesful attempts with that in the past. I could not get the solution which works seemlessly but here are some I have had near-sucess (i.e. for most of the URLs) [Since I was doing POC, results did not matter] See if that helps

    WebBrowser.DrawToBitmap() or other methods?

    http://www.codeproject.com/KB/graphics/html2image.aspx