Screen-print issue...

Hi all,

In my vaadin application I need to get a
screen capture of the Client
& upload that screen-shot to the server.
I was able to capture the screen & upload it to the server. But the problem is that
it always captures the SERVER’s screen & not the Client’s screen

Is there a way to get the client’s screen captured…??

Any help is greatly appreciated.
Thanks in advance.

How are you doing the screen capture ? If you are invoking code in your Vaadin application, you are likely capturing the console of your server, because the code runs on the server.

In order for the server to trigger a capture on the client, it would have to trigger execution of code remotely on the client. Vaadin remotely calls GWT components that are compiled to JavaScript, and can also invoke native JavaScript. Assuming you get that far, you then need to find a way for your client-side JavaScript to trigger a screen capture. I know of no portable way to do this (screen capture is a native function of your Windowing environment, and allowing JavaScript to run it would allow any site to spy on your users – any kinky site could capture what users were looking at and blackmail all their users).

So what you’re asking for is a massive security risk, and I’d be absolutely amazed if it is doable.

As Jean-François said, this is not possible from JavaScript for security reasons.

It might be possible with a browser side plugin to which the user gives sufficient permissions - look for possible solutions using a small Flash / Java applet / native browser plugin that you would call from the Vaadin application. I’m not sure if all these let you do it, either.


Just to add to Jean-François’ answer, you could use a java applet to do this; you may be able to adapt the code you already have on the server side. You would then need to integrate the applet in Gwt widget and then integrate the widget into a Vaadin component… (How are you going to “deliver” the captured image from the client to the server? I suspect the best way would be using an http post - but from the applet, or from the widget? I would add that I suspect this implementing this kind of screen capture functionality in the client is really quite difficult…)

For integrating the applet into the vaadin app: see

The applet would have to be signed to do a screen capture, and the user would have to “accept” the applet.

Note: I have no experience at all in creating applets, and can offer no more help than this!



Henri : It would be possible using java.awt.Robot in a (signed) java applet.

FWIW - whilst doing some brief Google research, I came across this commercial product that allows you to capture Images &
from java :

It’s got native parts, obviously, but runs on Linux, Mac & Windows. Useless in this context, as it won’t work in an applet (well, it will - if you install the .dll or equivalent on the client!), but pretty impressive nonetheless. I’ve no connection with the company, other than using one of their other products on one of our projects.



Hi all,

Thank you all for the prompt replies.
I’ll try to put those together & come up with a solution.

Also I had a look on the add-on
Maybe I might be able to give it a run too.

Thanks again.