Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ASP.Net, is there a programmatic way to take a screenshot of the browser content?

I have an ASP.Net application which as desired feature, users would like to be able to take a screenshot. While I know this can be simulated, it would be really great to have a way to take a URL (or the current rendered page), and turn it into an image which can be stored on the server.

Is this crazy? Is there a way to do it? If so, any references?

like image 580
pearcewg Avatar asked Oct 21 '08 01:10

pearcewg


3 Answers

I can tell you right now that there is no way to do it from inside the browser, nor should there be. Imagine that your page embeds GMail in an iframe. You could then steal a screenshot of the person's GMail inbox!

This could be made safe by having the browser "black out" all iframes and embeds that would violate cross-domain restrictions.

You could certainly write an extension to do this, but be aware of the security considerations outlined above.

Update: You can use a canvas utility function to get a screenshot of a page on the same origin as your code. There's even a lib to allow you to do this: http://experiments.hertzen.com/jsfeedback/

You can find other possible answers here: Using HTML5/Canvas/JavaScript to take screenshots

like image 181
treat your mods well Avatar answered Sep 22 '22 02:09

treat your mods well


Browsershots has an XML-RPC interface and available source code (in Python).

like image 26
Mark Cidade Avatar answered Sep 21 '22 02:09

Mark Cidade


I used the free assembly UrlScreenshot.dll which you can download here.

Works nicely!

There is also WebSiteScreenShot but it's not free.

like image 45
jdecuyper Avatar answered Sep 21 '22 02:09

jdecuyper