1

Is it possible to capture the screen or generate a hardcopy in GWT programatically?

using AWT its possible but the AWT can't be used in GWT[only GWT not any other like smartGWT, ext-GWT]?

John Smith
  • 1,095
  • 2
  • 11
  • 24

3 Answers3

2

On client side GWT do nothing more than Javascript. So your question is: Can I take screen shot in JavaScript? The answer is:

  1. If you want only take screen shot inside browser and can bear different you can use html2canvas.

  2. If you want also take screen shot out of browser, you have to use other technology such as ActiveX control (may be Java Applet with AWT).

Check this: Take a screenshot of a webpage with JavaScript?

Community
  • 1
  • 1
xeranic
  • 1,391
  • 1
  • 9
  • 16
  • 1. HTML2CANVAS, again have to deal with browser compatibility IE7, IE8 doesn't support CANVAS 2. As AWT is not supported in GWT so it ruled out. – John Smith Jun 11 '13 at 10:05
  • AWT is not supported in GWT, but you can write a Java Applet using AWT, and then invoke the Java Applet through JavaScript/GWT. But I'm not sure if Java Applet security allows you do that. ActiveX could be a solution, if you only on Windows... – xeranic Jun 11 '13 at 18:00
1

I don't believe that you will find anything native in GWT to do this. I believe that the best that you could manage would be something like this:

http://html2canvas.hertzen.com/

jsight
  • 27,819
  • 25
  • 107
  • 140
1

GWT just compiles java into javascript as it as been said by other guys in their answer. So you can look for a solution on the client but you can also do it on the server side.

One way to make it is to use phantomJS (which is a kind of webkit on the server) to rasterize the web page into an image on the server side. Could be really usefull to create features like "Export" etc Phantom JS scree n capture

Ronan Quillevere
  • 3,699
  • 1
  • 29
  • 44