2

Is there any way to print screen and get the clipboard data into an element?

In other words, is there a way to read print screened clipboard data (pixels, probably) with javascript?

Or once again this is the case where cannot get such data?

If any of the questions has the answer value of yes, I'd like to know a bit more details.

Thanks in advance!

tomsseisums
  • 13,168
  • 19
  • 83
  • 145

3 Answers3

3

You want to capture the screen and display it in canvas. Please see following link

http://html2canvas.hertzen.com/

Thanks

Shamaila Tahir
  • 988
  • 2
  • 8
  • 17
2

No, there is not, for security reasons.

The only thing that comes close is Mozilla's drawWindow command which only works locally.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171
  • I suspect, you might also be able to get the clipboard via Flash and perhaps from there into a canvas. At that point, though, you are dealing with ActionScript, not JavaScript. – dgvid Nov 04 '11 at 20:26
  • I'm not sure about flash but it is true that you can do similar with java applets. – Simon Sarris Nov 04 '11 at 20:43
1

Looks like there is a way, it's Chrome only, but it works flawlessly.

http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/

I hope it's only a matter of time until other browsers implement similar features, but yeah, there is a way. Plus, this could be tweaked to do almost anything.

tomsseisums
  • 13,168
  • 19
  • 83
  • 145